-
Notifications
You must be signed in to change notification settings - Fork 3.7k
[fix][broker] Fix index generator is not rollback after entries are failed added. #19727
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Conversation
|
@gaozhangmin Please add the following content to your PR description and select a checkbox: |
…ter entries added failed
c3dbfcf to
ddf9cb3
Compare
…ailed added. (#19727) Co-authored-by: gavingaozhangmin <gavingaozhangmin@didiglobal.com>
|
I support this patch, so +1 to it We should have discussed about this change on the mailing, a PIP is not needed, but we cannot do such changes without discussing them with the community. |
It makes sense to me. I'm also wondering whether it's accepted to add a default method to an interface for release branches. The initial purpose to prevent API changes to release branches is to ensure users can upgrade X.Y.Z to X.Y.(Z+1) without modifying any existing code. For example, if any method signature of Since @gaozhangmin added the labels to cherry-pick this PR to release branches, could you drive the discussion in the mail list? |
|
As discussed on the mailing list https://lists.apache.org/thread/w4jzk27qhtosgsz7l9bmhf1t7o9mxjhp, there is no plan to release 2.9.6, so I am going to remove the release/2.9.6 label |
Motivation
Line#800
beforeAddEntryinvokesinterceptor.interceptWithNumberOfMessages(brokerEntryMetadata, numberOfMessages);to increase the indexGenerator. But it doesn't rollback if entries added failed in LINE#804-813.This issue will cause the wrong index property set in managed ledger properties map. which would be recovery when managed ledger is initialized.
pulsar/managed-ledger/src/main/java/org/apache/bookkeeper/mledger/impl/ManagedLedgerImpl.java
Lines 799 to 816 in 4ed8a87
Modifications
Decrease the index generator in
AppendIndexMetadataInterceptorbyVerifying this change
org.apache.pulsar.broker.intercept.MangedLedgerInterceptorImplTest#testAddEntryFailed
Does this pull request potentially affect one of the following parts:
If the box was checked, please highlight the changes
Documentation
docdoc-requireddoc-not-neededdoc-completeMatching PR in forked repository
gaozhangmin#11