topic2.sim 13.2 KB
Newer Older
S
TD-3130  
Shengliang Guan 已提交
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19
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

S
TD-3130  
Shengliang Guan 已提交
20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39
sql insert into t1.p1 values(1, now, '1');
sql insert into t1.p1 values(1, now, '2');
sql insert into t1.p1 values(1, now, '3');
sql insert into t1.p1 values(1, now, '4')(2, now, '5')(3, now, '6')(4, now, '7')(5, now, '8')(6, now, '9');
sql insert into t1.p1 values(1, now, '10')(2, now, '11')(3, now, '12')(4, now, '13')(5, now, '14')(6, now, '15');
sql insert into t1.p1 values(1, now, '16')(2, now,'17')(3, now,'18')(4, now,'19')(5, now,'20')(6, now,'21')(7, now,'22')(8, now,'23')(9, now,'24')(10, now,'25')(11, now,'26')(12, now,'27')(13, now,'28')(14, now,'29')(15, now,'30')(16, now,'31')(17, now,'32')(18, now,'33');

sql insert into t1.p2 values(1, now, '1');
sql insert into t1.p2 values(1, now, '2');
sql insert into t1.p2 values(1, now, '3');
sql insert into t1.p2 values(1, now, '4')(2, now, '5')(3, now, '6')(4, now, '7')(5, now, '8')(6, now, '9');
sql insert into t1.p2 values(1, now, '10')(2, now, '11')(3, now, '12')(4, now, '13')(5, now, '14')(6, now, '15');
sql insert into t1.p2 values(1, now, '16')(2, now,'17')(3, now,'18')(4, now,'19')(5, now,'20')(6, now,'21')(7, now,'22')(8, now,'23')(9, now,'24')(10, now,'25')(11, now,'26')(12, now,'27')(13, now,'28')(14, now,'29')(15, now,'30')(16, now,'31')(17, now,'32')(18, now,'33');

sql_error insert into t1.p3 values(1, now, '1');
sql_error insert into t1.p3 values(1, now, '2');
sql_error insert into t1.p3 values(1, now, '3');
sql_error insert into t1.p3 values(1, now, '4')(2, now, '5')(3, now, '6')(4, now, '7')(5, now, '8')(6, now, '9');
sql_error insert into t1.p3 values(1, now, '10')(2, now, '11')(3, now, '12')(4, now, '13')(5, now, '14')(6, now, '15');
sql_error insert into t1.p3 values(1, now, '16')(2, now,'17')(3, now,'18')(4, now,'19')(5, now,'20')(6, now,'21')(7, now,'22')(8, now,'23')(9, now,'24')(10, now,'25')(11, now,'26')(12, now,'27')(13, now,'28')(14, now,'29')(15, now,'30')(16, now,'31')(17, now,'32')(18, now,'33');
S
TD-3130  
Shengliang Guan 已提交
40

S
TD-3220  
Shengliang Guan 已提交
41 42
sql select * from t1.p1 order by off asc
if $rows != 33 then 
S
TD-3130  
Shengliang Guan 已提交
43 44
  return -1
endi
S
TD-3130  
Shengliang Guan 已提交
45
if $data02 != 1 then 
S
TD-3130  
Shengliang Guan 已提交
46 47
  return -1
endi
S
TD-3130  
Shengliang Guan 已提交
48
if $data12 != 2 then 
S
TD-3130  
Shengliang Guan 已提交
49 50
  return -1
endi
S
TD-3130  
Shengliang Guan 已提交
51
if $data22 != 3 then 
S
TD-3130  
Shengliang Guan 已提交
52 53 54
  return -1
endi

S
TD-3220  
Shengliang Guan 已提交
55 56
sql select * from t1.p2 order by off asc
if $rows != 33 then 
S
TD-3130  
Shengliang Guan 已提交
57 58
  return -1
endi
S
TD-3130  
Shengliang Guan 已提交
59
if $data02 != 1 then 
S
TD-3130  
Shengliang Guan 已提交
60 61
  return -1
endi
S
TD-3130  
Shengliang Guan 已提交
62
if $data12 != 2 then 
S
TD-3130  
Shengliang Guan 已提交
63 64
  return -1
endi
S
TD-3130  
Shengliang Guan 已提交
65
if $data22 != 3 then 
S
TD-3130  
Shengliang Guan 已提交
66 67 68 69 70 71 72 73 74 75 76 77 78 79
  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

S
TD-3130  
Shengliang Guan 已提交
80 81 82 83 84 85 86 87 88 89 90 91 92 93 94 95 96 97 98 99 100 101 102 103 104 105 106 107 108 109 110 111 112 113
sql insert into t1.p1 values(1, now, '1');
sql insert into t1.p1 values(1, now, '2');
sql insert into t1.p1 values(1, now, '3');
sql insert into t1.p1 values(1, now, '4')(2, now, '5')(3, now, '6')(4, now, '7')(5, now, '8')(6, now, '9');
sql insert into t1.p1 values(1, now, '10')(2, now, '11')(3, now, '12')(4, now, '13')(5, now, '14')(6, now, '15');
sql insert into t1.p1 values(1, now, '16')(2, now,'17')(3, now,'18')(4, now,'19')(5, now,'20')(6, now,'21')(7, now,'22')(8, now,'23')(9, now,'24')(10, now,'25')(11, now,'26')(12, now,'27')(13, now,'28')(14, now,'29')(15, now,'30')(16, now,'31')(17, now,'32')(18, now,'33');

sql insert into t1.p2 values(1, now, '1');
sql insert into t1.p2 values(1, now, '2');
sql insert into t1.p2 values(1, now, '3');
sql insert into t1.p2 values(1, now, '4')(2, now, '5')(3, now, '6')(4, now, '7')(5, now, '8')(6, now, '9');
sql insert into t1.p2 values(1, now, '10')(2, now, '11')(3, now, '12')(4, now, '13')(5, now, '14')(6, now, '15');
sql insert into t1.p2 values(1, now, '16')(2, now,'17')(3, now,'18')(4, now,'19')(5, now,'20')(6, now,'21')(7, now,'22')(8, now,'23')(9, now,'24')(10, now,'25')(11, now,'26')(12, now,'27')(13, now,'28')(14, now,'29')(15, now,'30')(16, now,'31')(17, now,'32')(18, now,'33');

sql insert into t1.p3 values(1, now, '1');
sql insert into t1.p3 values(1, now, '2');
sql insert into t1.p3 values(1, now, '3');
sql insert into t1.p3 values(1, now, '4')(2, now, '5')(3, now, '6')(4, now, '7')(5, now, '8')(6, now, '9');
sql insert into t1.p3 values(1, now, '10')(2, now, '11')(3, now, '12')(4, now, '13')(5, now, '14')(6, now, '15');
sql insert into t1.p3 values(1, now, '16')(2, now,'17')(3, now,'18')(4, now,'19')(5, now,'20')(6, now,'21')(7, now,'22')(8, now,'23')(9, now,'24')(10, now,'25')(11, now,'26')(12, now,'27')(13, now,'28')(14, now,'29')(15, now,'30')(16, now,'31')(17, now,'32')(18, now,'33');

sql insert into t1.p4 values(1, now, '1');
sql insert into t1.p4 values(1, now, '2');
sql insert into t1.p4 values(1, now, '3');
sql insert into t1.p4 values(1, now, '4')(2, now, '5')(3, now, '6')(4, now, '7')(5, now, '8')(6, now, '9');
sql insert into t1.p4 values(1, now, '10')(2, now, '11')(3, now, '12')(4, now, '13')(5, now, '14')(6, now, '15');
sql insert into t1.p4 values(1, now, '16')(2, now,'17')(3, now,'18')(4, now,'19')(5, now,'20')(6, now,'21')(7, now,'22')(8, now,'23')(9, now,'24')(10, now,'25')(11, now,'26')(12, now,'27')(13, now,'28')(14, now,'29')(15, now,'30')(16, now,'31')(17, now,'32')(18, now,'33');

sql_error insert into t1.p5 values(1, now, '1');
sql_error insert into t1.p5 values(1, now, '2');
sql_error insert into t1.p5 values(1, now, '3');
sql_error insert into t1.p5 values(1, now, '4')(2, now, '5')(3, now, '6')(4, now, '7')(5, now, '8')(6, now, '9');
sql_error insert into t1.p5 values(1, now, '10')(2, now, '11')(3, now, '12')(4, now, '13')(5, now, '14')(6, now, '15');
sql_error insert into t1.p5 values(1, now, '16')(2, now,'17')(3, now,'18')(4, now,'19')(5, now,'20')(6, now,'21')(7, now,'22')(8, now,'23')(9, now,'24')(10, now,'25')(11, now,'26')(12, now,'27')(13, now,'28')(14, now,'29')(15, now,'30')(16, now,'31')(17, now,'32')(18, now,'33');
S
TD-3130  
Shengliang Guan 已提交
114

S
TD-3220  
Shengliang Guan 已提交
115 116
sql select * from t1.p1 order by off asc
if $rows != 66 then 
S
TD-3130  
Shengliang Guan 已提交
117 118
  return -1
endi
S
TD-3130  
Shengliang Guan 已提交
119
if $data02 != 1 then 
S
TD-3130  
Shengliang Guan 已提交
120 121
  return -1
endi
S
TD-3130  
Shengliang Guan 已提交
122
if $data12 != 2 then 
S
TD-3130  
Shengliang Guan 已提交
123 124
  return -1
endi
S
TD-3130  
Shengliang Guan 已提交
125
if $data22 != 3 then 
S
TD-3130  
Shengliang Guan 已提交
126 127 128
  return -1
endi

S
TD-3220  
Shengliang Guan 已提交
129 130
sql select * from t1.p2 order by off asc
if $rows != 66 then 
S
TD-3130  
Shengliang Guan 已提交
131 132
  return -1
endi
S
TD-3130  
Shengliang Guan 已提交
133
if $data02 != 1 then 
S
TD-3130  
Shengliang Guan 已提交
134 135
  return -1
endi
S
TD-3130  
Shengliang Guan 已提交
136
if $data12 != 2 then 
S
TD-3130  
Shengliang Guan 已提交
137 138
  return -1
endi
S
TD-3130  
Shengliang Guan 已提交
139
if $data22 != 3 then 
S
TD-3130  
Shengliang Guan 已提交
140 141 142
  return -1
endi

S
TD-3220  
Shengliang Guan 已提交
143 144
sql select * from t1.p3 order by off asc
if $rows != 33 then 
S
TD-3130  
Shengliang Guan 已提交
145 146
  return -1
endi
S
TD-3130  
Shengliang Guan 已提交
147
if $data02 != 1 then 
S
TD-3130  
Shengliang Guan 已提交
148 149
  return -1
endi
S
TD-3130  
Shengliang Guan 已提交
150
if $data12 != 2 then 
S
TD-3130  
Shengliang Guan 已提交
151 152
  return -1
endi
S
TD-3130  
Shengliang Guan 已提交
153
if $data22 != 3 then 
S
TD-3130  
Shengliang Guan 已提交
154 155 156
  return -1
endi

S
TD-3220  
Shengliang Guan 已提交
157 158
sql select * from t1.p4 order by off asc
if $rows != 33 then 
S
TD-3130  
Shengliang Guan 已提交
159 160
  return -1
endi
S
TD-3130  
Shengliang Guan 已提交
161
if $data02 != 1 then 
S
TD-3130  
Shengliang Guan 已提交
162 163
  return -1
endi
S
TD-3130  
Shengliang Guan 已提交
164
if $data12 != 2 then 
S
TD-3130  
Shengliang Guan 已提交
165 166
  return -1
endi
S
TD-3130  
Shengliang Guan 已提交
167
if $data22 != 3 then 
S
TD-3130  
Shengliang Guan 已提交
168 169 170 171 172 173 174 175 176 177 178 179 180 181
  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

S
TD-3130  
Shengliang Guan 已提交
182 183 184 185 186 187 188 189 190 191 192 193 194 195 196 197 198 199 200 201 202 203 204 205 206 207 208 209 210 211 212 213 214 215
sql insert into t1.p1 values(1, now, '1');
sql insert into t1.p1 values(1, now, '2');
sql insert into t1.p1 values(1, now, '3');
sql insert into t1.p1 values(1, now, '4')(2, now, '5')(3, now, '6')(4, now, '7')(5, now, '8')(6, now, '9');
sql insert into t1.p1 values(1, now, '10')(2, now, '11')(3, now, '12')(4, now, '13')(5, now, '14')(6, now, '15');
sql insert into t1.p1 values(1, now, '16')(2, now,'17')(3, now,'18')(4, now,'19')(5, now,'20')(6, now,'21')(7, now,'22')(8, now,'23')(9, now,'24')(10, now,'25')(11, now,'26')(12, now,'27')(13, now,'28')(14, now,'29')(15, now,'30')(16, now,'31')(17, now,'32')(18, now,'33');

sql_error insert into t1.p2 values(1, now, '1');
sql_error insert into t1.p2 values(1, now, '2');
sql_error insert into t1.p2 values(1, now, '3');
sql_error insert into t1.p2 values(1, now, '4')(2, now, '5')(3, now, '6')(4, now, '7')(5, now, '8')(6, now, '9');
sql_error insert into t1.p2 values(1, now, '10')(2, now, '11')(3, now, '12')(4, now, '13')(5, now, '14')(6, now, '15');
sql_error insert into t1.p2 values(1, now, '16')(2, now,'17')(3, now,'18')(4, now,'19')(5, now,'20')(6, now,'21')(7, now,'22')(8, now,'23')(9, now,'24')(10, now,'25')(11, now,'26')(12, now,'27')(13, now,'28')(14, now,'29')(15, now,'30')(16, now,'31')(17, now,'32')(18, now,'33');

sql_error insert into t1.p3 values(1, now, '1');
sql_error insert into t1.p3 values(1, now, '2');
sql_error insert into t1.p3 values(1, now, '3');
sql_error insert into t1.p3 values(1, now, '4')(2, now, '5')(3, now, '6')(4, now, '7')(5, now, '8')(6, now, '9');
sql_error insert into t1.p3 values(1, now, '10')(2, now, '11')(3, now, '12')(4, now, '13')(5, now, '14')(6, now, '15');
sql_error insert into t1.p3 values(1, now, '16')(2, now,'17')(3, now,'18')(4, now,'19')(5, now,'20')(6, now,'21')(7, now,'22')(8, now,'23')(9, now,'24')(10, now,'25')(11, now,'26')(12, now,'27')(13, now,'28')(14, now,'29')(15, now,'30')(16, now,'31')(17, now,'32')(18, now,'33');

sql_error insert into t1.p4 values(1, now, '1');
sql_error insert into t1.p4 values(1, now, '2');
sql_error insert into t1.p4 values(1, now, '3');
sql_error insert into t1.p4 values(1, now, '4')(2, now, '5')(3, now, '6')(4, now, '7')(5, now, '8')(6, now, '9');
sql_error insert into t1.p4 values(1, now, '10')(2, now, '11')(3, now, '12')(4, now, '13')(5, now, '14')(6, now, '15');
sql_error insert into t1.p4 values(1, now, '16')(2, now,'17')(3, now,'18')(4, now,'19')(5, now,'20')(6, now,'21')(7, now,'22')(8, now,'23')(9, now,'24')(10, now,'25')(11, now,'26')(12, now,'27')(13, now,'28')(14, now,'29')(15, now,'30')(16, now,'31')(17, now,'32')(18, now,'33');

sql_error insert into t1.p5 values(1, now, '1');
sql_error insert into t1.p5 values(1, now, '2');
sql_error insert into t1.p5 values(1, now, '3');
sql_error insert into t1.p5 values(1, now, '4')(2, now, '5')(3, now, '6')(4, now, '7')(5, now, '8')(6, now, '9');
sql_error insert into t1.p5 values(1, now, '10')(2, now, '11')(3, now, '12')(4, now, '13')(5, now, '14')(6, now, '15');
sql_error insert into t1.p5 values(1, now, '16')(2, now,'17')(3, now,'18')(4, now,'19')(5, now,'20')(6, now,'21')(7, now,'22')(8, now,'23')(9, now,'24')(10, now,'25')(11, now,'26')(12, now,'27')(13, now,'28')(14, now,'29')(15, now,'30')(16, now,'31')(17, now,'32')(18, now,'33');
S
TD-3130  
Shengliang Guan 已提交
216

S
TD-3220  
Shengliang Guan 已提交
217 218
sql select * from t1.p1 order by off asc
if $rows != 99 then 
S
TD-3130  
Shengliang Guan 已提交
219 220
  return -1
endi
S
TD-3130  
Shengliang Guan 已提交
221
if $data02 != 1 then 
S
TD-3130  
Shengliang Guan 已提交
222 223
  return -1
endi
S
TD-3130  
Shengliang Guan 已提交
224
if $data12 != 2 then 
S
TD-3130  
Shengliang Guan 已提交
225 226
  return -1
endi
S
TD-3130  
Shengliang Guan 已提交
227
if $data22 != 3 then 
S
TD-3130  
Shengliang Guan 已提交
228 229 230
  return -1
endi

S
TD-3220  
Shengliang Guan 已提交
231 232 233
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
S
TD-3130  
Shengliang Guan 已提交
234 235 236 237 238 239 240 241 242 243 244 245

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

S
TD-3130  
Shengliang Guan 已提交
246 247 248 249 250 251
sql insert into t1.p1 values(1, now, '1');
sql insert into t1.p1 values(1, now, '2');
sql insert into t1.p1 values(1, now, '3');
sql insert into t1.p1 values(1, now, '4')(2, now, '5')(3, now, '6')(4, now, '7')(5, now, '8')(6, now, '9');
sql insert into t1.p1 values(1, now, '10')(2, now, '11')(3, now, '12')(4, now, '13')(5, now, '14')(6, now, '15');
sql insert into t1.p1 values(1, now, '16')(2, now,'17')(3, now,'18')(4, now,'19')(5, now,'20')(6, now,'21')(7, now,'22')(8, now,'23')(9, now,'24')(10, now,'25')(11, now,'26')(12, now,'27')(13, now,'28')(14, now,'29')(15, now,'30')(16, now,'31')(17, now,'32')(18, now,'33');
S
TD-3130  
Shengliang Guan 已提交
252

S
TD-3130  
Shengliang Guan 已提交
253 254 255 256 257 258
sql insert into t1.p2 values(1, now, '1');
sql insert into t1.p2 values(1, now, '2');
sql insert into t1.p2 values(1, now, '3');
sql insert into t1.p2 values(1, now, '4')(2, now, '5')(3, now, '6')(4, now, '7')(5, now, '8')(6, now, '9');
sql insert into t1.p2 values(1, now, '10')(2, now, '11')(3, now, '12')(4, now, '13')(5, now, '14')(6, now, '15');
sql insert into t1.p2 values(1, now, '16')(2, now,'17')(3, now,'18')(4, now,'19')(5, now,'20')(6, now,'21')(7, now,'22')(8, now,'23')(9, now,'24')(10, now,'25')(11, now,'26')(12, now,'27')(13, now,'28')(14, now,'29')(15, now,'30')(16, now,'31')(17, now,'32')(18, now,'33');
S
TD-3130  
Shengliang Guan 已提交
259

S
TD-3130  
Shengliang Guan 已提交
260 261 262 263 264 265
sql insert into t1.p3 values(1, now, '1');
sql insert into t1.p3 values(1, now, '2');
sql insert into t1.p3 values(1, now, '3');
sql insert into t1.p3 values(1, now, '4')(2, now, '5')(3, now, '6')(4, now, '7')(5, now, '8')(6, now, '9');
sql insert into t1.p3 values(1, now, '10')(2, now, '11')(3, now, '12')(4, now, '13')(5, now, '14')(6, now, '15');
sql insert into t1.p3 values(1, now, '16')(2, now,'17')(3, now,'18')(4, now,'19')(5, now,'20')(6, now,'21')(7, now,'22')(8, now,'23')(9, now,'24')(10, now,'25')(11, now,'26')(12, now,'27')(13, now,'28')(14, now,'29')(15, now,'30')(16, now,'31')(17, now,'32')(18, now,'33');
S
TD-3130  
Shengliang Guan 已提交
266

S
TD-3130  
Shengliang Guan 已提交
267 268 269
sql_error insert into t1.p4 values(1, now, '1');
sql_error insert into t1.p5 values(1, now, '1');
sql_error insert into t1.p6 values(1, now, '1');
S
TD-3220  
Shengliang Guan 已提交
270 271 272
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
S
TD-3130  
Shengliang Guan 已提交
273

S
TD-3220  
Shengliang Guan 已提交
274 275
sql select * from t1.p1 order by off asc
if $rows != 132 then 
S
TD-3130  
Shengliang Guan 已提交
276 277
  return -1
endi
S
TD-3130  
Shengliang Guan 已提交
278
if $data02 != 1 then 
S
TD-3130  
Shengliang Guan 已提交
279 280
  return -1
endi
S
TD-3130  
Shengliang Guan 已提交
281
if $data12 != 2 then 
S
TD-3130  
Shengliang Guan 已提交
282 283
  return -1
endi
S
TD-3130  
Shengliang Guan 已提交
284
if $data22 != 3 then 
S
TD-3130  
Shengliang Guan 已提交
285 286 287
  return -1
endi

S
TD-3220  
Shengliang Guan 已提交
288 289
sql select * from t1.p2 order by off asc
if $rows != 33 then 
S
TD-3130  
Shengliang Guan 已提交
290 291
  return -1
endi
S
TD-3130  
Shengliang Guan 已提交
292
if $data02 != 1 then 
S
TD-3130  
Shengliang Guan 已提交
293 294
  return -1
endi
S
TD-3130  
Shengliang Guan 已提交
295
if $data12 != 2 then 
S
TD-3130  
Shengliang Guan 已提交
296 297
  return -1
endi
S
TD-3130  
Shengliang Guan 已提交
298
if $data22 != 3 then 
S
TD-3130  
Shengliang Guan 已提交
299 300 301
  return -1
endi

S
TD-3220  
Shengliang Guan 已提交
302 303
sql select * from t1.p3 order by off asc
if $rows != 33 then 
S
TD-3130  
Shengliang Guan 已提交
304 305
  return -1
endi
S
TD-3130  
Shengliang Guan 已提交
306
if $data02 != 1 then 
S
TD-3130  
Shengliang Guan 已提交
307 308
  return -1
endi
S
TD-3130  
Shengliang Guan 已提交
309
if $data12 != 2 then 
S
TD-3130  
Shengliang Guan 已提交
310 311
  return -1
endi
S
TD-3130  
Shengliang Guan 已提交
312
if $data22 != 3 then 
S
TD-3130  
Shengliang Guan 已提交
313 314 315
  return -1
endi

S
TD-3220  
Shengliang Guan 已提交
316 317
sql select * from t1.ps order by off asc
if $rows != 198 then 
S
TD-3130  
Shengliang Guan 已提交
318 319 320 321
  return -1
endi

system sh/exec.sh -n dnode1 -s stop -x SIGINT