system sh/stop_dnodes.sh system sh/deploy.sh -n dnode1 -i 1 system sh/exec.sh -n dnode1 -s start sleep 2000 sql connect print ==== step1 sql create topic t1 partitions 2; sql show t1.tables if $rows != 2 then return -1 endi sql show t1.vgroups if $rows != 2 then return -1 endi sql insert into t1.p1 values(1, '1'); sql insert into t1.p1 values(1, '2'); sql insert into t1.p1 values(1, '3'); sql insert into t1.p1 values(1, '4')(2, '5')(3, '6')(4, '7')(5, '8')(6, '9'); sql insert into t1.p1 values(1, '10')(2, '11')(3, '12')(4, '13')(5, '14')(6, '15'); sql insert into t1.p1 values(1, '16')(2, '17')(3, '18')(4, '19')(5, '20')(6, '21')(7, '22')(8, '23')(9, '24')(10, '25')(11, '26')(12, '27')(13, '28')(14, '29')(15, '30')(16, '31')(17, '32')(18, '33'); sql insert into t1.p2 values(1, '1'); sql insert into t1.p2 values(1, '2'); sql insert into t1.p2 values(1, '3'); sql insert into t1.p2 values(1, '4')(2, '5')(3, '6')(4, '7')(5, '8')(6, '9'); sql insert into t1.p2 values(1, '10')(2, '11')(3, '12')(4, '13')(5, '14')(6, '15'); sql insert into t1.p2 values(1, '16')(2, '17')(3, '18')(4, '19')(5, '20')(6, '21')(7, '22')(8, '23')(9, '24')(10, '25')(11, '26')(12, '27')(13, '28')(14, '29')(15, '30')(16, '31')(17, '32')(18, '33'); sql_error insert into t1.p3 values(1, '1'); sql_error insert into t1.p3 values(1, '2'); sql_error insert into t1.p3 values(1, '3'); sql_error insert into t1.p3 values(1, '4')(2, '5')(3, '6')(4, '7')(5, '8')(6, '9'); sql_error insert into t1.p3 values(1, '10')(2, '11')(3, '12')(4, '13')(5, '14')(6, '15'); sql_error insert into t1.p3 values(1, '16')(2, '17')(3, '18')(4, '19')(5, '20')(6, '21')(7, '22')(8, '23')(9, '24')(10, '25')(11, '26')(12, '27')(13, '28')(14, '29')(15, '30')(16, '31')(17, '32')(18, '33'); sql select * from t1.p1 order by off asc if $rows != 33 then return -1 endi if $data01 != 1 then return -1 endi if $data11 != 2 then return -1 endi if $data21 != 3 then return -1 endi sql select * from t1.p2 order by off asc if $rows != 33 then return -1 endi if $data01 != 1 then return -1 endi if $data11 != 2 then return -1 endi if $data21 != 3 then return -1 endi print ==== step2 sql alter topic t1 partitions 4; sql show t1.tables if $rows != 4 then return -1 endi sql show t1.vgroups if $rows != 4 then return -1 endi sql insert into t1.p1 values(1, '1'); sql insert into t1.p1 values(1, '2'); sql insert into t1.p1 values(1, '3'); sql insert into t1.p1 values(1, '4')(2, '5')(3, '6')(4, '7')(5, '8')(6, '9'); sql insert into t1.p1 values(1, '10')(2, '11')(3, '12')(4, '13')(5, '14')(6, '15'); sql insert into t1.p1 values(1, '16')(2, '17')(3, '18')(4, '19')(5, '20')(6, '21')(7, '22')(8, '23')(9, '24')(10, '25')(11, '26')(12, '27')(13, '28')(14, '29')(15, '30')(16, '31')(17, '32')(18, '33'); sql insert into t1.p2 values(1, '1'); sql insert into t1.p2 values(1, '2'); sql insert into t1.p2 values(1, '3'); sql insert into t1.p2 values(1, '4')(2, '5')(3, '6')(4, '7')(5, '8')(6, '9'); sql insert into t1.p2 values(1, '10')(2, '11')(3, '12')(4, '13')(5, '14')(6, '15'); sql insert into t1.p2 values(1, '16')(2, '17')(3, '18')(4, '19')(5, '20')(6, '21')(7, '22')(8, '23')(9, '24')(10, '25')(11, '26')(12, '27')(13, '28')(14, '29')(15, '30')(16, '31')(17, '32')(18, '33'); sql insert into t1.p3 values(1, '1'); sql insert into t1.p3 values(1, '2'); sql insert into t1.p3 values(1, '3'); sql insert into t1.p3 values(1, '4')(2, '5')(3, '6')(4, '7')(5, '8')(6, '9'); sql insert into t1.p3 values(1, '10')(2, '11')(3, '12')(4, '13')(5, '14')(6, '15'); sql insert into t1.p3 values(1, '16')(2, '17')(3, '18')(4, '19')(5, '20')(6, '21')(7, '22')(8, '23')(9, '24')(10, '25')(11, '26')(12, '27')(13, '28')(14, '29')(15, '30')(16, '31')(17, '32')(18, '33'); sql insert into t1.p4 values(1, '1'); sql insert into t1.p4 values(1, '2'); sql insert into t1.p4 values(1, '3'); sql insert into t1.p4 values(1, '4')(2, '5')(3, '6')(4, '7')(5, '8')(6, '9'); sql insert into t1.p4 values(1, '10')(2, '11')(3, '12')(4, '13')(5, '14')(6, '15'); sql insert into t1.p4 values(1, '16')(2, '17')(3, '18')(4, '19')(5, '20')(6, '21')(7, '22')(8, '23')(9, '24')(10, '25')(11, '26')(12, '27')(13, '28')(14, '29')(15, '30')(16, '31')(17, '32')(18, '33'); sql_error insert into t1.p5 values(1, '1'); sql_error insert into t1.p5 values(1, '2'); sql_error insert into t1.p5 values(1, '3'); sql_error insert into t1.p5 values(1, '4')(2, '5')(3, '6')(4, '7')(5, '8')(6, '9'); sql_error insert into t1.p5 values(1, '10')(2, '11')(3, '12')(4, '13')(5, '14')(6, '15'); sql_error insert into t1.p5 values(1, '16')(2, '17')(3, '18')(4, '19')(5, '20')(6, '21')(7, '22')(8, '23')(9, '24')(10, '25')(11, '26')(12, '27')(13, '28')(14, '29')(15, '30')(16, '31')(17, '32')(18, '33'); sql select * from t1.p1 order by off asc if $rows != 66 then return -1 endi if $data01 != 1 then return -1 endi if $data11 != 2 then return -1 endi if $data21 != 3 then return -1 endi sql select * from t1.p2 order by off asc if $rows != 66 then return -1 endi if $data01 != 1 then return -1 endi if $data11 != 2 then return -1 endi if $data21 != 3 then return -1 endi sql select * from t1.p3 order by off asc if $rows != 33 then return -1 endi if $data01 != 1 then return -1 endi if $data11 != 2 then return -1 endi if $data21 != 3 then return -1 endi sql select * from t1.p4 order by off asc if $rows != 33 then return -1 endi if $data01 != 1 then return -1 endi if $data11 != 2 then return -1 endi if $data21 != 3 then return -1 endi print ==== step3 sql alter topic t1 partitions 1; sql show t1.tables if $rows != 1 then return -1 endi sql show t1.vgroups if $rows != 1 then return -1 endi sql insert into t1.p1 values(1, '1'); sql insert into t1.p1 values(1, '2'); sql insert into t1.p1 values(1, '3'); sql insert into t1.p1 values(1, '4')(2, '5')(3, '6')(4, '7')(5, '8')(6, '9'); sql insert into t1.p1 values(1, '10')(2, '11')(3, '12')(4, '13')(5, '14')(6, '15'); sql insert into t1.p1 values(1, '16')(2, '17')(3, '18')(4, '19')(5, '20')(6, '21')(7, '22')(8, '23')(9, '24')(10, '25')(11, '26')(12, '27')(13, '28')(14, '29')(15, '30')(16, '31')(17, '32')(18, '33'); sql_error insert into t1.p2 values(1, '1'); sql_error insert into t1.p2 values(1, '2'); sql_error insert into t1.p2 values(1, '3'); sql_error insert into t1.p2 values(1, '4')(2, '5')(3, '6')(4, '7')(5, '8')(6, '9'); sql_error insert into t1.p2 values(1, '10')(2, '11')(3, '12')(4, '13')(5, '14')(6, '15'); sql_error insert into t1.p2 values(1, '16')(2, '17')(3, '18')(4, '19')(5, '20')(6, '21')(7, '22')(8, '23')(9, '24')(10, '25')(11, '26')(12, '27')(13, '28')(14, '29')(15, '30')(16, '31')(17, '32')(18, '33'); sql_error insert into t1.p3 values(1, '1'); sql_error insert into t1.p3 values(1, '2'); sql_error insert into t1.p3 values(1, '3'); sql_error insert into t1.p3 values(1, '4')(2, '5')(3, '6')(4, '7')(5, '8')(6, '9'); sql_error insert into t1.p3 values(1, '10')(2, '11')(3, '12')(4, '13')(5, '14')(6, '15'); sql_error insert into t1.p3 values(1, '16')(2, '17')(3, '18')(4, '19')(5, '20')(6, '21')(7, '22')(8, '23')(9, '24')(10, '25')(11, '26')(12, '27')(13, '28')(14, '29')(15, '30')(16, '31')(17, '32')(18, '33'); sql_error insert into t1.p4 values(1, '1'); sql_error insert into t1.p4 values(1, '2'); sql_error insert into t1.p4 values(1, '3'); sql_error insert into t1.p4 values(1, '4')(2, '5')(3, '6')(4, '7')(5, '8')(6, '9'); sql_error insert into t1.p4 values(1, '10')(2, '11')(3, '12')(4, '13')(5, '14')(6, '15'); sql_error insert into t1.p4 values(1, '16')(2, '17')(3, '18')(4, '19')(5, '20')(6, '21')(7, '22')(8, '23')(9, '24')(10, '25')(11, '26')(12, '27')(13, '28')(14, '29')(15, '30')(16, '31')(17, '32')(18, '33'); sql_error insert into t1.p5 values(1, '1'); sql_error insert into t1.p5 values(1, '2'); sql_error insert into t1.p5 values(1, '3'); sql_error insert into t1.p5 values(1, '4')(2, '5')(3, '6')(4, '7')(5, '8')(6, '9'); sql_error insert into t1.p5 values(1, '10')(2, '11')(3, '12')(4, '13')(5, '14')(6, '15'); sql_error insert into t1.p5 values(1, '16')(2, '17')(3, '18')(4, '19')(5, '20')(6, '21')(7, '22')(8, '23')(9, '24')(10, '25')(11, '26')(12, '27')(13, '28')(14, '29')(15, '30')(16, '31')(17, '32')(18, '33'); sql select * from t1.p1 order by off asc if $rows != 99 then return -1 endi if $data01 != 1 then return -1 endi if $data11 != 2 then return -1 endi if $data21 != 3 then return -1 endi sql_error select * from t1.p2 order by off asc sql_error select * from t1.p3 order by off asc sql_error select * from t1.p4 order by off asc print ==== step4 sql alter topic t1 partitions 3; sql show t1.tables if $rows != 3 then return -1 endi sql show t1.vgroups if $rows != 3 then return -1 endi sql insert into t1.p1 values(1, '1'); sql insert into t1.p1 values(1, '2'); sql insert into t1.p1 values(1, '3'); sql insert into t1.p1 values(1, '4')(2, '5')(3, '6')(4, '7')(5, '8')(6, '9'); sql insert into t1.p1 values(1, '10')(2, '11')(3, '12')(4, '13')(5, '14')(6, '15'); sql insert into t1.p1 values(1, '16')(2, '17')(3, '18')(4, '19')(5, '20')(6, '21')(7, '22')(8, '23')(9, '24')(10, '25')(11, '26')(12, '27')(13, '28')(14, '29')(15, '30')(16, '31')(17, '32')(18, '33'); sql insert into t1.p2 values(1, '1'); sql insert into t1.p2 values(1, '2'); sql insert into t1.p2 values(1, '3'); sql insert into t1.p2 values(1, '4')(2, '5')(3, '6')(4, '7')(5, '8')(6, '9'); sql insert into t1.p2 values(1, '10')(2, '11')(3, '12')(4, '13')(5, '14')(6, '15'); sql insert into t1.p2 values(1, '16')(2, '17')(3, '18')(4, '19')(5, '20')(6, '21')(7, '22')(8, '23')(9, '24')(10, '25')(11, '26')(12, '27')(13, '28')(14, '29')(15, '30')(16, '31')(17, '32')(18, '33'); sql insert into t1.p3 values(1, '1'); sql insert into t1.p3 values(1, '2'); sql insert into t1.p3 values(1, '3'); sql insert into t1.p3 values(1, '4')(2, '5')(3, '6')(4, '7')(5, '8')(6, '9'); sql insert into t1.p3 values(1, '10')(2, '11')(3, '12')(4, '13')(5, '14')(6, '15'); sql insert into t1.p3 values(1, '16')(2, '17')(3, '18')(4, '19')(5, '20')(6, '21')(7, '22')(8, '23')(9, '24')(10, '25')(11, '26')(12, '27')(13, '28')(14, '29')(15, '30')(16, '31')(17, '32')(18, '33'); sql_error insert into t1.p4 values(1, '1'); sql_error insert into t1.p5 values(1, '1'); sql_error insert into t1.p6 values(1, '1'); sql_error select * from t1.p4 order by off asc sql_error select * from t1.p5 order by off asc sql_error select * from t1.p6 order by off asc sql select * from t1.p1 order by off asc if $rows != 132 then return -1 endi if $data01 != 1 then return -1 endi if $data11 != 2 then return -1 endi if $data21 != 3 then return -1 endi sql select * from t1.p2 order by off asc if $rows != 33 then return -1 endi if $data01 != 1 then return -1 endi if $data11 != 2 then return -1 endi if $data21 != 3 then return -1 endi sql select * from t1.p3 order by off asc if $rows != 33 then return -1 endi if $data01 != 1 then return -1 endi if $data11 != 2 then return -1 endi if $data21 != 3 then return -1 endi sql select * from t1.ps order by off asc if $rows != 198 then return -1 endi system sh/exec.sh -n dnode1 -s stop -x SIGINT