-
Notifications
You must be signed in to change notification settings - Fork 3.7k
[fix][ml] Enhance OpFindNewest to support skip non-recoverable data #24441
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][ml] Enhance OpFindNewest to support skip non-recoverable data #24441
Conversation
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.
Pull Request Overview
Enhance OpFindNewest to skip non-recoverable ledger data during timestamp-based seeks and add end-to-end tests to verify this behavior.
- Enable
autoSkipNonRecoverableDatain tests and broker config - Add
testSeekByTimestampWithSkipNonRecoverableDatainSubscriptionSeekTest - Add new tests in
PersistentMessageFinderTestfor auto-skip logic - Extend
OpFindNewestto handle non-recoverable exceptions and advance search accordingly
Reviewed Changes
Copilot reviewed 3 out of 3 changed files in this pull request and generated 2 comments.
| File | Description |
|---|---|
| pulsar-broker/src/test/java/org/apache/pulsar/broker/service/SubscriptionSeekTest.java | Enable auto-skip and add a timestamp-seek test that deletes ledgers mid-stream |
| pulsar-broker/src/test/java/org/apache/pulsar/broker/service/PersistentMessageFinderTest.java | Configure autoSkipNonRecoverableData and add two tests for message finding with deleted ledgers |
| managed-ledger/src/main/java/org/apache/bookkeeper/mledger/impl/OpFindNewest.java | Implement handling of NonRecoverableLedgerException in binary search states |
Comments suppressed due to low confidence (2)
pulsar-broker/src/test/java/org/apache/pulsar/broker/service/SubscriptionSeekTest.java:627
- [nitpick] The variable name
lis ambiguous and may be mistaken for the digit1; rename it tonextIndexor similar for clarity.
int l = i;
pulsar-broker/src/test/java/org/apache/pulsar/broker/service/SubscriptionSeekTest.java:50
- Apache Commons Lang3 does not provide an ArraySorter utility class; consider using java.util.Arrays.sort(timestamps) to avoid an invalid import.
import org.apache.commons.lang3.ArraySorter;
pulsar-broker/src/test/java/org/apache/pulsar/broker/service/SubscriptionSeekTest.java
Outdated
Show resolved
Hide resolved
managed-ledger/src/main/java/org/apache/bookkeeper/mledger/impl/OpFindNewest.java
Show resolved
Hide resolved
@coderzc Could you please elaborate above description? It's not clear about why the ledger will be removed from the metadata store when they are not offloaded successfully. As I understand, it should be an expected behavior for the ledger removed from the metadata storage. It might cause by BUGs, or users deleted the ledger manually without deleting the topic, right? |
managed-ledger/src/main/java/org/apache/bookkeeper/mledger/impl/OpFindNewest.java
Outdated
Show resolved
Hide resolved
managed-ledger/src/main/java/org/apache/bookkeeper/mledger/impl/OpFindNewest.java
Outdated
Show resolved
Hide resolved
Yes, this is an expected behavior, this fix only to unblock seeking by timestamp for topic with non-recoverable ledger. for why this expected behavior occurs, we need to continue investigating. |
be0ff77 to
71f263f
Compare
71f263f to
54bcb7b
Compare
8a7f517 to
17074c2
Compare
pulsar-broker/src/test/java/org/apache/pulsar/broker/service/SubscriptionSeekTest.java
Outdated
Show resolved
Hide resolved
pulsar-broker/src/test/java/org/apache/pulsar/broker/service/SubscriptionSeekTest.java
Outdated
Show resolved
Hide resolved
pulsar-broker/src/test/java/org/apache/pulsar/broker/service/PersistentMessageFinderTest.java
Outdated
Show resolved
Hide resolved
pulsar-broker/src/test/java/org/apache/pulsar/broker/service/SubscriptionSeekTest.java
Outdated
Show resolved
Hide resolved
managed-ledger/src/main/java/org/apache/bookkeeper/mledger/impl/OpFindNewest.java
Show resolved
Hide resolved
managed-ledger/src/main/java/org/apache/bookkeeper/mledger/impl/OpFindNewest.java
Outdated
Show resolved
Hide resolved
…pache#24441) (cherry picked from commit 3e36632) (cherry picked from commit 0063a88)
…pache#24441) (cherry picked from commit 3e36632) (cherry picked from commit bd5eed4)
…pache#24441) (cherry picked from commit 3e36632) (cherry picked from commit 0063a88)
…pache#24441) (cherry picked from commit 3e36632) (cherry picked from commit bd5eed4)
…pache#24441) (cherry picked from commit 3e36632)
…pache#24441) (cherry picked from commit 3e36632)
Motivation
When some ledgers are not offloaded successfully, they will be removed from the metadata store so that seek by timestamp might fail.
skipNonRecoverableData is true, but it does not handle the seek case. The workaround is to see by message id.
Modifications
When
skipNonRecoverableDatais true, OpFindNewest can auto skip non-recoverable data.Verifying this change
(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:)
Does this pull request potentially affect one of the following parts:
If the box was checked, please highlight the changes
Documentation
docdoc-requireddoc-not-neededdoc-completeMatching PR in forked repository
PR in forked repository: