topic2.sim 10.9 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-3220  
Shengliang Guan 已提交
20 21 22 23 24 25
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');
S
TD-3130  
Shengliang Guan 已提交
26

S
TD-3220  
Shengliang Guan 已提交
27 28 29 30 31 32
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');
S
TD-3130  
Shengliang Guan 已提交
33

S
TD-3220  
Shengliang Guan 已提交
34 35 36 37 38 39
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');
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-3220  
Shengliang Guan 已提交
45
if $data01 != 1 then 
S
TD-3130  
Shengliang Guan 已提交
46 47
  return -1
endi
S
TD-3220  
Shengliang Guan 已提交
48
if $data11 != 2 then 
S
TD-3130  
Shengliang Guan 已提交
49 50
  return -1
endi
S
TD-3220  
Shengliang Guan 已提交
51
if $data21 != 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-3220  
Shengliang Guan 已提交
59
if $data01 != 1 then 
S
TD-3130  
Shengliang Guan 已提交
60 61
  return -1
endi
S
TD-3220  
Shengliang Guan 已提交
62
if $data11 != 2 then 
S
TD-3130  
Shengliang Guan 已提交
63 64
  return -1
endi
S
TD-3220  
Shengliang Guan 已提交
65
if $data21 != 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-3220  
Shengliang Guan 已提交
80 81 82 83 84 85
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');
S
TD-3130  
Shengliang Guan 已提交
86

S
TD-3220  
Shengliang Guan 已提交
87 88 89 90 91 92
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');
S
TD-3130  
Shengliang Guan 已提交
93

S
TD-3220  
Shengliang Guan 已提交
94 95 96 97 98 99
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');
S
TD-3130  
Shengliang Guan 已提交
100

S
TD-3220  
Shengliang Guan 已提交
101 102 103 104 105 106
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');
S
TD-3130  
Shengliang Guan 已提交
107

S
TD-3220  
Shengliang Guan 已提交
108 109 110 111 112 113
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');
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-3220  
Shengliang Guan 已提交
119
if $data01 != 1 then 
S
TD-3130  
Shengliang Guan 已提交
120 121
  return -1
endi
S
TD-3220  
Shengliang Guan 已提交
122
if $data11 != 2 then 
S
TD-3130  
Shengliang Guan 已提交
123 124
  return -1
endi
S
TD-3220  
Shengliang Guan 已提交
125
if $data21 != 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-3220  
Shengliang Guan 已提交
133
if $data01 != 1 then 
S
TD-3130  
Shengliang Guan 已提交
134 135
  return -1
endi
S
TD-3220  
Shengliang Guan 已提交
136
if $data11 != 2 then 
S
TD-3130  
Shengliang Guan 已提交
137 138
  return -1
endi
S
TD-3220  
Shengliang Guan 已提交
139
if $data21 != 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-3220  
Shengliang Guan 已提交
147
if $data01 != 1 then 
S
TD-3130  
Shengliang Guan 已提交
148 149
  return -1
endi
S
TD-3220  
Shengliang Guan 已提交
150
if $data11 != 2 then 
S
TD-3130  
Shengliang Guan 已提交
151 152
  return -1
endi
S
TD-3220  
Shengliang Guan 已提交
153
if $data21 != 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-3220  
Shengliang Guan 已提交
161
if $data01 != 1 then 
S
TD-3130  
Shengliang Guan 已提交
162 163
  return -1
endi
S
TD-3220  
Shengliang Guan 已提交
164
if $data11 != 2 then 
S
TD-3130  
Shengliang Guan 已提交
165 166
  return -1
endi
S
TD-3220  
Shengliang Guan 已提交
167
if $data21 != 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-3220  
Shengliang Guan 已提交
182 183 184 185 186 187
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');
S
TD-3130  
Shengliang Guan 已提交
188

S
TD-3220  
Shengliang Guan 已提交
189 190 191 192 193 194
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');
S
TD-3130  
Shengliang Guan 已提交
195

S
TD-3220  
Shengliang Guan 已提交
196 197 198 199 200 201
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');
S
TD-3130  
Shengliang Guan 已提交
202

S
TD-3220  
Shengliang Guan 已提交
203 204 205 206 207 208
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');
S
TD-3130  
Shengliang Guan 已提交
209

S
TD-3220  
Shengliang Guan 已提交
210 211 212 213 214 215
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');
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-3220  
Shengliang Guan 已提交
221
if $data01 != 1 then 
S
TD-3130  
Shengliang Guan 已提交
222 223
  return -1
endi
S
TD-3220  
Shengliang Guan 已提交
224
if $data11 != 2 then 
S
TD-3130  
Shengliang Guan 已提交
225 226
  return -1
endi
S
TD-3220  
Shengliang Guan 已提交
227
if $data21 != 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-3220  
Shengliang Guan 已提交
246 247 248 249 250 251
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');
S
TD-3130  
Shengliang Guan 已提交
252

S
TD-3220  
Shengliang Guan 已提交
253 254 255 256 257 258
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');
S
TD-3130  
Shengliang Guan 已提交
259

S
TD-3220  
Shengliang Guan 已提交
260 261 262 263 264 265
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');
S
TD-3130  
Shengliang Guan 已提交
266

S
TD-3220  
Shengliang Guan 已提交
267 268 269 270 271 272
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
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-3220  
Shengliang Guan 已提交
278
if $data01 != 1 then 
S
TD-3130  
Shengliang Guan 已提交
279 280
  return -1
endi
S
TD-3220  
Shengliang Guan 已提交
281
if $data11 != 2 then 
S
TD-3130  
Shengliang Guan 已提交
282 283
  return -1
endi
S
TD-3220  
Shengliang Guan 已提交
284
if $data21 != 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-3220  
Shengliang Guan 已提交
292
if $data01 != 1 then 
S
TD-3130  
Shengliang Guan 已提交
293 294
  return -1
endi
S
TD-3220  
Shengliang Guan 已提交
295
if $data11 != 2 then 
S
TD-3130  
Shengliang Guan 已提交
296 297
  return -1
endi
S
TD-3220  
Shengliang Guan 已提交
298
if $data21 != 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-3220  
Shengliang Guan 已提交
306
if $data01 != 1 then 
S
TD-3130  
Shengliang Guan 已提交
307 308
  return -1
endi
S
TD-3220  
Shengliang Guan 已提交
309
if $data11 != 2 then 
S
TD-3130  
Shengliang Guan 已提交
310 311
  return -1
endi
S
TD-3220  
Shengliang Guan 已提交
312
if $data21 != 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