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 — [Bug] Batch deleted Index lost when cursor recover from metadataStore · Issue #20585 · apache/pulsar

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

New issue
Copy link
New issue
Copy link
Closed
Closed
[Bug] Batch deleted Index lost when cursor recover from metadataStore#20585
Copy link
Labels
Stalearea/MLtype/bugThe PR fixed a bug or issue reported a bug

Description

@lifepuzzlefun
lifepuzzlefun
opened on Jun 15, 2023
Issue body actions

Search before asking

  • I searched in the issues and found nothing similar.

Version

master code.

Minimal reproduce step

see code

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();

What did you expect to see?

the logic should the same as

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

Lines 465 to 510 in bbf5273

void recover(final VoidCallback callback) {
// Read the meta-data ledgerId from the store
log.info("[{}] Recovering from bookkeeper ledger cursor: {}", ledger.getName(), name);
ledger.getStore().asyncGetCursorInfo(ledger.getName(), name, new MetaStoreCallback<ManagedCursorInfo>() {
@Override
public void operationComplete(ManagedCursorInfo info, Stat stat) {
updateCursorLedgerStat(info, stat);
lastActive = info.getLastActive() != 0 ? info.getLastActive() : lastActive;
if (log.isDebugEnabled()) {
log.debug("[{}] [{}] Recover cursor last active to [{}]", ledger.getName(), name, lastActive);
}
Map<String, String> recoveredCursorProperties = Collections.emptyMap();
if (info.getCursorPropertiesCount() > 0) {
// Recover properties map
recoveredCursorProperties = new HashMap<>();
for (int i = 0; i < info.getCursorPropertiesCount(); i++) {
StringProperty property = info.getCursorProperties(i);
recoveredCursorProperties.put(property.getName(), property.getValue());
}
}
cursorProperties = recoveredCursorProperties;
if (info.getCursorsLedgerId() == -1L) {
// There is no cursor ledger to read the last position from. It means the cursor has been properly
// closed and the last mark-delete position is stored in the ManagedCursorInfo itself.
PositionImpl recoveredPosition = new PositionImpl(info.getMarkDeleteLedgerId(),
info.getMarkDeleteEntryId());
if (info.getIndividualDeletedMessagesCount() > 0) {
recoverIndividualDeletedMessages(info.getIndividualDeletedMessagesList());
}
Map<String, Long> recoveredProperties = Collections.emptyMap();
if (info.getPropertiesCount() > 0) {
// Recover properties map
recoveredProperties = new HashMap<>();
for (int i = 0; i < info.getPropertiesCount(); i++) {
LongProperty property = info.getProperties(i);
recoveredProperties.put(property.getName(), property.getValue());
}
}
recoveredCursor(recoveredPosition, recoveredProperties, recoveredCursorProperties, null);
callback.operationComplete();

What did you see instead?

Anything else?

No response

Are you willing to submit a PR?

  • I'm willing to submit a PR!

Activity

  1. lifepuzzlefun
    added
    type/bugThe PR fixed a bug or issue reported a bug
    on Jun 15, 2023
  2. github-actions commented on Jul 16, 2023

    @github-actions
    github-actionsBot
    on Jul 16, 2023
    More actions

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

  3. github-actions
    added
    Stale
    on Jul 16, 2023
  4. merlimat
    added
    area/ML
    on Oct 24, 2026
  5. merlimat commented on Oct 24, 2026

    @merlimat
    merlimat
    on Oct 24, 2026
    Contributor
    More actions

    Thanks @lifepuzzlefun for the report. This was fixed by #26474: when there is no cursor ledger (cursorsLedgerId == -1), ManagedCursorImpl.recover now restores the batch deletion indexes stored in ManagedCursorInfo too, the same way the cursor-ledger path does (managed-ledger/src/main/java/org/apache/bookkeeper/mledger/impl/ManagedCursorImpl.java, lines 602-615 on master). Closing as fixed. If you still see batch acks lost after a reload on a supported release (4.0.x, 4.2.x or 5.0.x), please reopen with the details.

  6. merlimat
    closed this as completedon Oct 24, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    Stalearea/MLtype/bugThe PR fixed a bug or issue reported a bug

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions

      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.