Commit f5eca38
committed
[fix][broker] Check replication cluster before starting the replicator
Fixes apache#20010
### Motivation
`PersistentTopicTest.testCreateTopicWithZombieReplicatorCursor` is flaky
because the cursor could still be created again in `startReplicator`,
which could be called by:
```
onPoliciesUpdate
checkReplicationAndRetryOnFailure
checkReplication
```
### Modifications
- Call `checkReplicationCluster` before calling `startReplicator`.
- Sleep for a while in the test to reduce the flakiness caused by the
asynchronous update of the policies1 parent 42a6969 commit f5eca38
2 files changed
Lines changed: 23 additions & 4 deletions
File tree
- pulsar-broker/src
- main/java/org/apache/pulsar/broker/service/persistent
- test/java/org/apache/pulsar/broker/service/persistent
Lines changed: 7 additions & 1 deletion
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
1542 | 1542 | | |
1543 | 1543 | | |
1544 | 1544 | | |
1545 | | - | |
| 1545 | + | |
| 1546 | + | |
| 1547 | + | |
| 1548 | + | |
| 1549 | + | |
| 1550 | + | |
| 1551 | + | |
1546 | 1552 | | |
1547 | 1553 | | |
1548 | 1554 | | |
| |||
Lines changed: 16 additions & 3 deletions
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
38 | 38 | | |
39 | 39 | | |
40 | 40 | | |
| 41 | + | |
41 | 42 | | |
42 | 43 | | |
43 | 44 | | |
| |||
52 | 53 | | |
53 | 54 | | |
54 | 55 | | |
| 56 | + | |
55 | 57 | | |
56 | 58 | | |
57 | 59 | | |
| |||
83 | 85 | | |
84 | 86 | | |
85 | 87 | | |
| 88 | + | |
86 | 89 | | |
87 | 90 | | |
88 | 91 | | |
| |||
576 | 579 | | |
577 | 580 | | |
578 | 581 | | |
| 582 | + | |
| 583 | + | |
| 584 | + | |
| 585 | + | |
579 | 586 | | |
580 | 587 | | |
581 | 588 | | |
| |||
584 | 591 | | |
585 | 592 | | |
586 | 593 | | |
587 | | - | |
588 | | - | |
589 | | - | |
| 594 | + | |
| 595 | + | |
| 596 | + | |
| 597 | + | |
| 598 | + | |
| 599 | + | |
| 600 | + | |
| 601 | + | |
| 602 | + | |
590 | 603 | | |
591 | 604 | | |
0 commit comments