Skip to content

[Bug][broker] expired ledger cannot be cleanup when ledger consumed completely #15473

Closed as not planned

Description

@Nicklee007

Describe the bug
In some case, expired ledger data cannot be cleanup when the topic has not new message and ledger consumed completely, because the slowestReaderPosition which set to the new ledger will be cover to the old ledger by some cursor operator which like flink reset the Durable Cursor and the auto flushed dirty mark-delete position.

Also, the last expired ledger can not be clean if the topic has not active consumer and expired the message by MessageExpiryMonitor or the cursor markDeletePosition are in some old ledger when stop produce message.

image

To Reproduce
Steps to reproduce the behavior:

  1. For quickly reproduce we change the config managedLedgerMaxLedgerRolloverTimeMinutes and managedLedgerMinLedgerRolloverTimeMinutes to few minutes.
  2. start broker, create topic and set-message-ttl and set-retention to 4 * managedLedgerMaxLedgerRolloverTimeMinutes;
  3. create Subscription and produce some message longer than set-message-ttl;
  4. stop producer and wait the message expired by MessageExpiryMonitor;
  5. the are two ledger. The has data ledger's all message are expired but can not be cleanup.

Expected behavior
All expired ledger data should be cleanup. There are many expired ledger's data can not be clean , If we have many not new message's topic. we also need migrate the ledger data when we offline one bookie.

Additional context
The bug can be reproduce before the pulsar version 2.10.1, the current master pr #14672 change the behavior of rollCurrentLedgerIfFull when roll full ledger could not create new ledger, I think should resume the behavior to create new ledger.

Activity

  1. added
    type/bug
    on May 6, 2022
  2. github-actions commented on Jun 6, 2022

    @github-actions

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

  3. merlimat commented on Oct 24, 2026

    @merlimat
    Contributor

    Thanks @Nicklee007 for the report. This was reported on a Pulsar release before 3.0, which is no longer supported; the supported releases are 4.0.x, 4.2.x and 5.0.x. Much of the code involved has changed since, and the problem hasn't been confirmed on a current release, so I'm closing it as part of cleaning up old reports. If you still see it on a supported release, please open a new issue with the version and steps to reproduce, and link this one.

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

    Staletype/bug

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions