一、问题处理说明 二级分区表在openGauss内核侧暂不支持exchange partition功能。
二、问题描述 【测试类型:工具功能】【测试版本:master】mysql在线创建range-hash复合分区表后exchange partition,opengauss侧数据未交换,chameleon工具进程中断 https://e.gitee.com/opengaussorg/dashboard?issue=I5FPJF 在该问题单中对二级分区表与普通表进行exchange partition操作,报错信息为:For subpartition table, exchange partition is not yet supported. 测试样例为创建二级分区表,插入数据,创建普通表,执行exchange partition交换数据。 MySQL侧执行语句为: create table t_chameleon_ddl_1701_1 ( salary int, birthday date ) partition by range(salary) subpartition by hash(year(birthday)) subpartitions 3 ( partition p1 values less than (2000), partition p2 values less than (3000), partition p3 values less than (5000), partition p4 values less than (6000), partition p5 values less than (8000), partition p6 values less than maxvalue ); INSERT INTO t_chameleon_ddl_1701_1 VALUES (1000,'1990-10-12'), (2000,'1997-01-10'), (3000,'1999-10-10'),(5000,'1993-04-12'),(6000,'2000-11-12'),(11100,'2003-02-25'); create table t_chameleon_ddl_1701_2 ( salary int, birthday date ); alter table t_chameleon_ddl_1701_1 exchange partition p1sp1 with table t_chameleon_ddl_1701_2; 在mysql经过工具迁移后报错显示如下:
转化后的openGauss侧语句为: CREATE TABLE "sch_mysql_database"."t_chameleon_ddl_1701_1" ( "salary" integer NULL , "birthday" date NULL ) PARTITION BY RANGE(salary) SUBPARTITION BY HASH(birthday) ( PARTITION p1 VALUES LESS THAN (2000 ) ( SUBPARTITION p1_0 , SUBPARTITION p1_1 , SUBPARTITION p1_2 ), PARTITION p2 VALUES LESS THAN (3000 ) ( SUBPARTITION p2_0 , SUBPARTITION p2_1 , SUBPARTITION p2_2 ), PARTITION p3 VALUES LESS THAN (5000 ) ( SUBPARTITION p3_0 , SUBPARTITION p3_1 , SUBPARTITION p3_2 ), PARTITION p4 VALUES LESS THAN (6000 ) ( SUBPARTITION p4_0 , SUBPARTITION p4_1 , SUBPARTITION p4_2 ), PARTITION p5 VALUES LESS THAN (8000 ) ( SUBPARTITION p5_0 , SUBPARTITION p5_1 , SUBPARTITION p5_2 ), PARTITION p6 VALUES LESS THAN (maxvalue) ( SUBPARTITION p6_0 , SUBPARTITION p6_1 , SUBPARTITION p6_2 )); INSERT INTO t_chameleon_ddl_1701_1 VALUES (1000,'1990-10-12'), (2000,'1997-01-10'), (3000,'1999-10-10'),(5000,'1993-04-12'),(6000,'2000-11-12'),(11100,'2003-02-25'); CREATE TABLE "sch_mysql_database"."t_chameleon_ddl_1701_2" ( "salary" integer NULL , "birthday" date NULL ); ALTER TABLE sch_mysql_database.t_chameleon_ddl_1701_1 EXCHANGE PARTITION (p1sp1) WITH TABLE sch_mysql_database.t_chameleon_ddl_1701_2 ;
将转化后的openGauss的ddl语句在openGauss中直接执行后的结果为:
ERROR: Un-support feature DETAIL: For subpartition table, exchange partition is not yet supported.
三、根因分析 在在线迁移过程中alter分区表的功能对一级分区表可以实现,但在处理含有二级分区的分区表时候,在openGauss中显示报错。其中对应语句在openGauss内核中显示为:for subpartition table,exchange partition is not support yet
对于二级分区表,ALTER TABLE exchange partition功能在openGauss内核暂不支持。该问题无法从chameleon工具层面进行解决。
四、消减或规避措施 在用户使用该功能时进行提示,提示该功能暂不支持。 五、处理满足度 六、影响分析 带有二级分区的分区表可以正常执行 ALTER PARTITION中的ADD/DROP/TRUNCATE功能;COALESCE,REORGANIZE功能需要用到MERGE/SPLIT,暂不支持;EXCHANGE 也暂不支持。 七、决策点 是否将该问题单转需求