You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@pulsar.apache.org by "gaozhangmin (via GitHub)" <gi...@apache.org> on 2023/03/06 12:10:31 UTC

[GitHub] [pulsar] gaozhangmin opened a new pull request, #19727: [fix][broker] Fix index generator is not rollback after entries are failed added.

gaozhangmin opened a new pull request, #19727:
URL: https://github.com/apache/pulsar/pull/19727

   ### Motivation
   Line#800 `beforeAddEntry` invokes `interceptor.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.
   
   https://github.com/apache/pulsar/blob/4ed8a871bfa9a7a8e30d86d782e33a556646d7b1/managed-ledger/src/main/java/org/apache/bookkeeper/mledger/impl/ManagedLedgerImpl.java#L799-L816)
   
   ### Modifications
   
   Decrease the index generator in `AppendIndexMetadataInterceptor` by
   ```
   public void decreaseWithNumberOfMessages(int numberOfMessages) {
           indexGenerator.addAndGet(-numberOfMessages);
       }
   ```
   
   ### Verifying this change
   
   org.apache.pulsar.broker.intercept.MangedLedgerInterceptorImplTest#testAddEntryFailed
   
   ### Does this pull request potentially affect one of the following parts:
   
   <!-- DO NOT REMOVE THIS SECTION. CHECK THE PROPER BOX ONLY. -->
   
   *If the box was checked, please highlight the changes*
   
   - [ ] Dependencies (add or upgrade a dependency)
   - [ ] The public API
   - [ ] The schema
   - [ ] The default values of configurations
   - [ ] The threading model
   - [ ] The binary protocol
   - [ ] The REST endpoints
   - [ ] The admin CLI options
   - [ ] The metrics
   - [ ] Anything that affects deployment
   
   ### Documentation
   
   <!-- DO NOT REMOVE THIS SECTION. CHECK THE PROPER BOX ONLY. -->
   
   - [ ] `doc` <!-- Your PR contains doc changes. -->
   - [ ] `doc-required` <!-- Your PR changes impact docs and you will update later -->
   - [ ] `doc-not-needed` <!-- Your PR changes do not impact docs -->
   - [ ] `doc-complete` <!-- Docs have been already added -->
   
   ### Matching PR in forked repository
   https://github.com/gaozhangmin/pulsar/pull/11
   


-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: commits-unsubscribe@pulsar.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org


[GitHub] [pulsar] Technoboy- merged pull request #19727: [fix][broker] Fix index generator is not rollback after entries are failed added.

Posted by "Technoboy- (via GitHub)" <gi...@apache.org>.
Technoboy- merged PR #19727:
URL: https://github.com/apache/pulsar/pull/19727


-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: commits-unsubscribe@pulsar.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org


[GitHub] [pulsar] eolivelli commented on pull request #19727: [fix][broker] Fix index generator is not rollback after entries are failed added.

Posted by "eolivelli (via GitHub)" <gi...@apache.org>.
eolivelli commented on PR #19727:
URL: https://github.com/apache/pulsar/pull/19727#issuecomment-1465687715

   @poorbarcode @BewareMyPower 
   
   I support this patch, so +1 to it 
   but
   this change is a "API change", as we are adding a new method to the [ManagedLedgerInterceptor] (https://github.com/apache/pulsar/pull/19727/files)   API
   
   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.
   


-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: commits-unsubscribe@pulsar.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org


[GitHub] [pulsar] BewareMyPower commented on pull request #19727: [fix][broker] Fix index generator is not rollback after entries are failed added.

Posted by "BewareMyPower (via GitHub)" <gi...@apache.org>.
BewareMyPower commented on PR #19727:
URL: https://github.com/apache/pulsar/pull/19727#issuecomment-1465739941

   > We should have discussed about this change on the mailing
   
   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 `BrokerEntryMetadataInterceptor` is modified, all existing plugins (protocol handlers, connectors, etc.) that use an interceptor could be affected. I'm not sure whether adding a default method could affect the compatibility.
   
   Since @gaozhangmin added the labels to cherry-pick this PR to release branches, could you drive the discussion in the mail list?


-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: commits-unsubscribe@pulsar.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org


[GitHub] [pulsar] michaeljmarshall commented on pull request #19727: [fix][broker] Fix index generator is not rollback after entries are failed added.

Posted by "michaeljmarshall (via GitHub)" <gi...@apache.org>.
michaeljmarshall commented on PR #19727:
URL: https://github.com/apache/pulsar/pull/19727#issuecomment-1610271845

   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


-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: commits-unsubscribe@pulsar.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org


[GitHub] [pulsar] github-actions[bot] commented on pull request #19727: [fix][broker] Fix index generator is not rollback after entries are failed added.

Posted by "github-actions[bot] (via GitHub)" <gi...@apache.org>.
github-actions[bot] commented on PR #19727:
URL: https://github.com/apache/pulsar/pull/19727#issuecomment-1456021332

   @gaozhangmin Please add the following content to your PR description and select a checkbox:
   ```
   - [ ] `doc` <!-- Your PR contains doc changes -->
   - [ ] `doc-required` <!-- Your PR changes impact docs and you will update later -->
   - [ ] `doc-not-needed` <!-- Your PR changes do not impact docs -->
   - [ ] `doc-complete` <!-- Docs have been already added -->
   ```


-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: commits-unsubscribe@pulsar.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org


[GitHub] [pulsar] gaozhangmin commented on pull request #19727: [fix][broker] Fix index generator is not rollback after entries are failed added.

Posted by "gaozhangmin (via GitHub)" <gi...@apache.org>.
gaozhangmin commented on PR #19727:
URL: https://github.com/apache/pulsar/pull/19727#issuecomment-1467407024

   https://lists.apache.org/thread/m0tpp7f0ftf6cg0cpq25l23lx6gzgwl9 @eolivelli @BewareMyPower 


-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: commits-unsubscribe@pulsar.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org