Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[fix][broker] Avoid block markDeletePosition forward when skip lost entries #4

Open
wants to merge 10 commits into
base: master
Choose a base branch
from

Conversation

hanmz
Copy link
Owner

@hanmz hanmz commented Sep 20, 2023

Motivation

The configuration autoSkipNonRecoverableData is designed to turn this feature on if we can accept partial data loss. When some entries is lost, the broker will still work. cursor.readPosition will move to next position for skip these positions.
But now we have this problem: cursor.readPosition can move to next positition, but the cursor.markDeletePosition can not forward.

for example:

  1. topic-1 has some entries: [1:1],[1:2],[1:3],[1:4],[1:5],[1:6],[1:7],[1:8]
  2. entry [1,4] and [1,5] lost
  3. cursor read entry from ledger, then send message [1:1],[1:2],[1:3],[1:6],[1:7],[1:8] to consumer. (Current: readPosition=[1:8], markDeletePosition=[1:1])
  4. consumer individual ack [1:1],[1:2],[1:3],[1:6],[1:7],[1:8] (Current: readPosition=[1:8], markDeletePosition=[1:3])
  5. markDeletePosition will stay at [1:3], can not move forward to [1:8]

The root cause is: When entries lost, lost entries not be delete from cursor.

Modifications

When skip lost entries, delete these entries from cursor.

Documentation

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

@hanmz
Copy link
Owner Author

hanmz commented Oct 8, 2023

/pulsarbot rerun-failure-checks

@hanmz hanmz changed the title Delete skip entries for moving markDeletePosition forward. [fix][broker] Avoid block markDeletePosition forward when skip lost entries Oct 8, 2023
@hanmz
Copy link
Owner Author

hanmz commented Oct 8, 2023

/pulsarbot rerun-failure-checks

Copy link

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

@github-actions github-actions bot added the Stale label Nov 20, 2023
hanmz and others added 2 commits April 1, 2024 15:20
# Conflicts:
#	managed-ledger/src/test/java/org/apache/bookkeeper/mledger/impl/ManagedCursorTest.java
@github-actions github-actions bot added the PIP label Oct 9, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants