You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@pulsar.apache.org by "AnonHxy (via GitHub)" <gi...@apache.org> on 2023/02/16 09:33:11 UTC

[GitHub] [pulsar] AnonHxy opened a new pull request, #19537: [fix][ml] Fix ML init fail if ledger file was deleted from disk

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

   ### Motivation
   
   If we delete the ledger file from the bookkeeper,  we could open the ledger but will read fail.   Then if we restart the broker server to trigger ManagedLedgerImpl initializes,  the `AppendIndexMetadataInterceptor` will try to read the LAC position to recovery the index, which will cause the topic creating fail, see line425
   
   https://github.com/apache/pulsar/blob/cb306c8e6c5da3a05ea312a5e5746eb178d9ab10/managed-ledger/src/main/java/org/apache/bookkeeper/mledger/impl/ManagedLedgerImpl.java#L421-L427
   
   To fix it , we should do the same action as line434~line435 if `BKNoSuchLedgerExistsException` thrown.
   
   https://github.com/apache/pulsar/blob/cb306c8e6c5da3a05ea312a5e5746eb178d9ab10/managed-ledger/src/main/java/org/apache/bookkeeper/mledger/impl/ManagedLedgerImpl.java#L432-L436
   
   ### Modifications
   
   Removing the ledger from `ManagedLedgerImpl` and call `initializeBookKeeper()` if  `managedLedgerInterceptor.onManagedLedgerLastLedgerInitialize` throws `BKNoSuchLedgerExistsException`,
   instead of callback fail.
   
   ### Verifying this change
   
   - [x] Make sure that the change passes the CI checks.
   - Add UT `org.apache.pulsar.broker.service.PersistentTopicTest#testLastEntryReadErrorWhenInitWithManagedLedgerInterceptor`
   
   
   
   ### 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 -->
   - [X] `doc-not-needed` <!-- Your PR changes do not impact docs -->
   - [ ] `doc-complete` <!-- Docs have been already added -->
   
   ### Matching PR in forked repository
   
   PR in forked repository: <!-- ENTER URL HERE -->
   
   <!--
   After opening this PR, the build in apache/pulsar will fail and instructions will
   be provided for opening a PR in the PR author's forked repository.
   
   apache/pulsar pull requests should be first tested in your own fork since the 
   apache/pulsar CI based on GitHub Actions has constrained resources and quota.
   GitHub Actions provides separate quota for pull requests that are executed in 
   a forked repository.
   
   The tests will be run in the forked repository until all PR review comments have
   been handled, the tests pass and the PR is approved by a reviewer.
   -->
   


-- 
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 #19537: [fix][ml] Fix ML init fail if ledger file was deleted from disk

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

   The pr had no activity for 30 days, mark with Stale 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] AnonHxy closed pull request #19537: [fix][ml] Fix ML init fail if ledger file was deleted from disk

Posted by "AnonHxy (via GitHub)" <gi...@apache.org>.
AnonHxy closed pull request #19537: [fix][ml] Fix ML init fail if ledger file was deleted from disk
URL: https://github.com/apache/pulsar/pull/19537


-- 
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