GV

GeezerVison

The World Wide Web, restored to 800 pixels of glory.

Home|About|Gaming cabinet|Archives|How it works|Starter sites

On this site

  • Sign in
  • ActionsCI/CD and automation
  • CodespacesCloud development environments
  • All Features
  • Documentation
  • Training
  • Certifications
  • Build with Copilot
  • Customize Copilot
  • Integrations
  • Trending repos
  • GitHub Sponsors
  • Developer articles
  • Enterprises

This view

  • Original page
  • New address

GeezerVison is showing github.com — [improve][broker] Recover batch deleted Index when cursor recover from metadataStore. by lifepuzzlefun · Pull Request #20018 · apache/pulsar

Conversation

@lifepuzzlefun

@lifepuzzlefun lifepuzzlefun commented Apr 5, 2023 •
edited
Loading

Uh oh!

There was an error while loading. Please reload this page.

Copy link
Copy Markdown
Contributor

Motivation

fix #20585

just add the logic the same as recoverFromLedger(ManagedCursorInfo,VoidCallback) to the recover(VoidCallback)

pulsar/managed-ledger/src/main/java/org/apache/bookkeeper/mledger/impl/ManagedCursorImpl.java

Lines 597 to 606 in bbf5273

PositionImpl position = new PositionImpl(positionInfo);
if (positionInfo.getIndividualDeletedMessagesCount() > 0) {
recoverIndividualDeletedMessages(positionInfo.getIndividualDeletedMessagesList());
}
if (config.isDeletionAtBatchIndexLevelEnabled()
&& positionInfo.getBatchedEntryDeletionIndexInfoCount() > 0) {
recoverBatchDeletedIndexes(positionInfo.getBatchedEntryDeletionIndexInfoList());
}
recoveredCursor(position, recoveredProperties, cursorProperties, lh);
callback.operationComplete();

i think both the logic is the same either recover from metadataStore or cursorLedger.

Modifications

add logic on recoverBatchDeletedIndex .

Verifying this change

  • Make sure that the change passes the CI checks.

(Please pick either of the following options)

This change is a trivial rework / code cleanup without any test coverage.

(or)

This change is already covered by existing tests, such as (please describe tests).

(or)

This change added tests and can be verified as follows:

(example:)

  • Added integration tests for end-to-end deployment with large payloads (10MB)
  • Extended integration test for recovery after broker failure

Does this pull request potentially affect one of the following parts:

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

  • doc
  • doc-required
  • doc-not-needed
  • doc-complete

Matching PR in forked repository

PR in forked repository:

Sorry, something went wrong.

Uh oh!

There was an error while loading. Please reload this page.

All reactions
@lifepuzzlefun
add missing logic when cursor recover from metadataStore info.
0a796b4
@github-actions github-actions Bot added the doc-not-needed Your PR changes do not impact docs label Apr 5, 2023
@lhotari

lhotari commented Apr 6, 2023

Copy link
Copy Markdown
Member

Good catch. Please add tests to cover this PR. The test should fail without the fix and pass with the fix in this PR.

lifepuzzlefun reacted with laugh emoji
All reactions
  • 😄 1 reaction

Sorry, something went wrong.

Uh oh!

There was an error while loading. Please reload this page.

@lifepuzzlefun
add unit test case on cursor recover batch delete index
94e04c4
@lifepuzzlefun

lifepuzzlefun commented May 9, 2023

Copy link
Copy Markdown
Contributor Author

@lhotari @codelipenghui @Technoboy- can you take a look ?

All reactions

Sorry, something went wrong.

Uh oh!

There was an error while loading. Please reload this page.

@github-actions

github-actions Bot commented Jun 9, 2023

Copy link
Copy Markdown

The pr had no activity for 30 days, mark with Stale label.

All reactions

Sorry, something went wrong.

Uh oh!

There was an error while loading. Please reload this page.

@github-actions github-actions Bot added the Stale label Jun 9, 2023
@tisonkun
tisonkun requested review from Technoboy- and lhotari June 15, 2023 14:44
@tisonkun tisonkun added the ready-to-test label Jun 15, 2023
@tisonkun
Merge branch 'master' into fix_cursor_recover_ignored_batch_ack_index
bff4426
@Technoboy- Technoboy- added this to the 3.2.0 milestone Jul 31, 2023
@Technoboy- Technoboy- modified the milestones: 3.2.0, 3.3.0 Dec 22, 2023
@coderzc coderzc modified the milestones: 3.3.0, 3.4.0 May 8, 2024
@lhotari
Merge branch 'master' into fix_cursor_recover_ignored_batch_ack_index
40b9638
lhotari
lhotari approved these changes Oct 9, 2024
View reviewed changes
@lhotari
lhotari requested a review from dlg99 October 9, 2024 14:36
@lhotari lhotari closed this Oct 10, 2024
@lhotari lhotari reopened this Oct 10, 2024
@lhotari lhotari modified the milestones: 4.0.0, 4.1.0 Oct 14, 2024
@lhotari lhotari added the release/4.0.1 label Oct 14, 2024
@lhotari lhotari added release/4.0.2 and removed release/4.0.1 labels Dec 6, 2024
@lhotari lhotari removed the release/4.0.2 label Jan 6, 2025
@lhotari lhotari removed this from the 4.1.0 milestone Jan 6, 2025
@lhotari

lhotari commented Aug 21, 2026

Copy link
Copy Markdown
Member

@lifepuzzlefun Please rebase or close this if it's no longer relevant.

All reactions

Sorry, something went wrong.

Uh oh!

There was an error while loading. Please reload this page.

lhotari
lhotari reviewed Aug 21, 2026
View reviewed changes

@lhotari lhotari left a comment

Copy link
Copy Markdown
Member

There was a problem hiding this comment.

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Please rebase

Sorry, something went wrong.

Uh oh!

There was an error while loading. Please reload this page.

All reactions
@lhotari
lhotari self-requested a review August 21, 2026 19:33
@merlimat

merlimat commented Oct 17, 2026

Copy link
Copy Markdown
Contributor

Thanks @lifepuzzlefun, you diagnosed this correctly back in 2023, and I'm sorry it never got merged. The same fix landed in #26474 (ManagedCursorImpl.recover() now restores batchedEntryDeletionIndexInfos on the cursorsLedgerId == -1 path), and it has been cherry-picked to branch-4.2 and branch-4.0. Rebasing this PR would leave an empty diff, so I'm closing it as superseded, and I'm closing #20585 as fixed by #26474.

All reactions

Sorry, something went wrong.

Uh oh!

There was an error while loading. Please reload this page.

@merlimat merlimat closed this Oct 17, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Reviewers

@Technoboy- Technoboy- Awaiting requested review from Technoboy-
@dlg99 dlg99 Awaiting requested review from dlg99
@lhotari lhotari Awaiting requested review from lhotari

Uh oh!

There was an error while loading. Please reload this page.

Assignees

No one assigned

Labels

doc-not-needed Your PR changes do not impact docs ready-to-test Stale

Projects

None yet

Milestone

No milestone

Development

Successfully merging this pull request may close these issues.

[Bug] Batch deleted Index lost when cursor recover from metadataStore

Uh oh!

There was an error while loading. Please reload this page.

6 participants

@lifepuzzlefun @lhotari @merlimat @Technoboy- @tisonkun @coderzc
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
You are visitor 01402775 — GeezerVison does not store the pages you look up.
Best viewed with Netscape Navigator 4.7 or Internet Explorer 6 at 800×600. No cookies required.