Commit 2bed5ff
authored
[fix][test]fix flaky test MLPendingAckStoreTest.testMainProcess (apache#18310)
Fixes apache#18230
### Motivation
`ManagedCursorImpl` has a known problem: when the `cursor.close` and the `cursor.switchLedger` are concurrent executing, a bad version exception is thrown. see:
https://github.com/apache/pulsar/blob/0c3c175eb132d4ef0fb3a12842127dcb4fa1933d/managed-ledger/src/main/java/org/apache/bookkeeper/mledger/impl/ManagedCursorImpl.java#L2595-L2619
In this test, it hit this problem:
- `MlPendingAckStore.clearUselessLogData` will trigger `cursor.switchLedger` if it is the first execute `mard delete`.
- `MlPendingAckStore.close` will trigger `cursor.close`
### Modifications
if `MlPendingAckStore.close` fail, just retry, it will be ok1 parent d54c2cb commit 2bed5ff
File tree
1 file changed
+18
-2
lines changed- pulsar-broker/src/test/java/org/apache/pulsar/broker/transaction/pendingack/impl
1 file changed
+18
-2
lines changedLines changed: 18 additions & 2 deletions
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
256 | 256 | | |
257 | 257 | | |
258 | 258 | | |
259 | | - | |
260 | | - | |
| 259 | + | |
| 260 | + | |
| 261 | + | |
| 262 | + | |
| 263 | + | |
| 264 | + | |
| 265 | + | |
| 266 | + | |
| 267 | + | |
| 268 | + | |
| 269 | + | |
| 270 | + | |
| 271 | + | |
| 272 | + | |
| 273 | + | |
| 274 | + | |
| 275 | + | |
| 276 | + | |
261 | 277 | | |
262 | 278 | | |
263 | 279 | | |
| |||
0 commit comments