You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@doris.apache.org by GitBox <gi...@apache.org> on 2020/03/13 10:44:00 UTC

[GitHub] [incubator-doris] kangkaisen commented on a change in pull request #3101: use default_rowset_type to replace compaction_rowset_type

kangkaisen commented on a change in pull request #3101: use default_rowset_type to replace compaction_rowset_type
URL: https://github.com/apache/incubator-doris/pull/3101#discussion_r392152698
 
 

 ##########
 File path: docs/documentation/cn/administrator-guide/segment-v2-usage.md
 ##########
 @@ -0,0 +1,118 @@
+# Doris Segment V2上线和试用手册
+
+## 背景
+
+Doris 0.12版本中实现了segment v2(新的存储格式),引入词典压缩、bitmap索引、page cache等优化,能够提升系统性能。目前0.12版本已经发布alpha版本,正在内部上线过程中,上线的方案和试用方法记录如下
+
+## 上线
+
+为了保证上线的稳定性,上线分为三个阶段:
+第一个阶段是上线0.12版本,但是不全量开启segment v2的功能,只在验证的时候,创建segment v2的表(或者索引)
+第二个阶段是全量开启segment v2的功能,替换现有的segment存储格式,这样对新表会创建segment v2的格式的存储文件,但是对于旧表,需要依赖于compaction和schema change等过程,实现格式的转化
+第三个阶段就是转化旧的segment格式到新的segment v2的格式,这个需要在验证segment v2的正确性和性能没有问题之后,可以按照用户意愿逐步完成。
+
+### 上线验证
+
+- 正确性
+
+正确性是segment v2上线最需要保证的指标。 在第一阶段,为了保证线上环境的稳定性,并且验证segment v2的正确性,采用如下的方案:
+1. 选择几个需要验证的表,使用以下语句,创建segment v2格式的rollup表,该rollup表与base表的schema相同
+
+	alter table table_name add rollup table_name (columns) properties ("storage_format" = "v2");
+
+	其中,
+	rollup后面的index名字直接指定为base table的table name,该语句会自动生成一个__v2_table_name。
+
+	columns可以随便指定一个列名即可,这里一方面是为了兼容现有的语法,一方面是为了方便。
+
+2. 上面的创建出来的rollup index名字格式类似:__v2_table_name
+
+	通过命令 :
+
+	`desc table_name all;`
+
+	查看table中是否存在名字:__v2_table_name的rollup。由于创建segment v2的rollup表是一个异步操作,所以并不会立即成功。如果上面命令中并没有显示新创建的 rollup,可能是还在创建过程中。
+
+    可以通过下面命令查看正在进行的 rollup 表。
+
+	`show alter table rollup;`
+
+	看到会有一个名字为__v2_table_name的rollup表正在创建。
+
+3. 通过查询base表和segment v2格式的rollup表,验证查询结果是否一致(查询可以来自audit日志)
+
+	为了让查询使用segment v2的rollup表,增加了一个session变量,通过在查询中使用如下的语句,来查询segment v2格式的index:
+
+	set use_v2_rollup = true;
 
 Review comment:
   Why you strong coupling segment v2 and use_v2_rollup?
   I think use_v2_rollup isn't related  with use_v2_rollup.

----------------------------------------------------------------
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
 
For queries about this service, please contact Infrastructure at:
users@infra.apache.org


With regards,
Apache Git Services

---------------------------------------------------------------------
To unsubscribe, e-mail: commits-unsubscribe@doris.apache.org
For additional commands, e-mail: commits-help@doris.apache.org