Commit 9d44617
authored
Avoid adding duplicated BrokerEntryMetadata (#12018)
### Motivation
When the Pulsar cluster enables broker entry metadata, sometimes there're some corrupted entries. See streamnative/kop#442 for example. It's because the broker entry metadata has been added twice.
This bug might be introduced from #9039 https://github.com/apache/pulsar/blob/9b7c3275c904ac1e6a8ef67487a10a0506bb2c58/managed-ledger/src/main/java/org/apache/bookkeeper/mledger/impl/ManagedLedgerImpl.java#L1516-L1518
It happened during a managed ledger's rollover while there're some pending `OpAddEntry`s in `updateLedgersIdsComplete`, only the ledger id should be updated and the data of `OpAddEntry` should not be modified.
### Modifications
Only call `beforeAddEntry` for once at the beginning of `internalAsyncAddEntry`.1 parent dbd09d7 commit 9d44617
File tree
1 file changed
+5
-7
lines changed- managed-ledger/src/main/java/org/apache/bookkeeper/mledger/impl
1 file changed
+5
-7
lines changedLines changed: 5 additions & 7 deletions
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
717 | 717 | | |
718 | 718 | | |
719 | 719 | | |
| 720 | + | |
| 721 | + | |
| 722 | + | |
720 | 723 | | |
721 | 724 | | |
722 | 725 | | |
| |||
779 | 782 | | |
780 | 783 | | |
781 | 784 | | |
782 | | - | |
783 | | - | |
784 | | - | |
785 | | - | |
| 785 | + | |
786 | 786 | | |
787 | 787 | | |
788 | 788 | | |
| |||
1513 | 1513 | | |
1514 | 1514 | | |
1515 | 1515 | | |
1516 | | - | |
1517 | | - | |
1518 | | - | |
| 1516 | + | |
1519 | 1517 | | |
1520 | 1518 | | |
1521 | 1519 | | |
| |||
0 commit comments