Commit c701c5b
authored
Fix race condition in multi-shard rollup start/stop tests (#1529)
The rollup start/stop tests with multiple shards were experiencing race
conditions leading to version conflicts. The issue occurred when:
1. Test reads rollup document (seqNo = N)
2. Active rollup runner updates the document (seqNo = N+1)
3. Test tries to update with seqNo = N → 409 Version Conflict
The stop/start actions perform two sequential updates:
- First: Update rollup metadata status
- Second: Enable/disable the rollup job
The fix moves the _stop and _start API calls inside the waitFor block,
ensuring automatic retries on version conflicts. This is consistent with
the pattern already used in other rollup and transform tests.
Fixed tests:
- RestStopRollupActionIT: test stop rollup when multiple shards configured for IM config index
- RestStartRollupActionIT: test start rollup when multiple shards configured for IM config index
Signed-off-by: bowenlan-amzn <[email protected]>1 parent 39b856d commit c701c5b
File tree
2 files changed
+16
-9
lines changed- src/test/kotlin/org/opensearch/indexmanagement/rollup/resthandler
2 files changed
+16
-9
lines changedLines changed: 7 additions & 5 deletions
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
245 | 245 | | |
246 | 246 | | |
247 | 247 | | |
248 | | - | |
249 | 248 | | |
250 | | - | |
251 | | - | |
252 | | - | |
253 | | - | |
| 249 | + | |
| 250 | + | |
| 251 | + | |
| 252 | + | |
| 253 | + | |
| 254 | + | |
| 255 | + | |
254 | 256 | | |
255 | 257 | | |
256 | 258 | | |
| |||
Lines changed: 9 additions & 4 deletions
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
305 | 305 | | |
306 | 306 | | |
307 | 307 | | |
| 308 | + | |
| 309 | + | |
| 310 | + | |
| 311 | + | |
| 312 | + | |
| 313 | + | |
| 314 | + | |
| 315 | + | |
| 316 | + | |
308 | 317 | | |
309 | | - | |
310 | | - | |
311 | | - | |
312 | | - | |
313 | 318 | | |
314 | 319 | | |
315 | 320 | | |
| |||
0 commit comments