-
Notifications
You must be signed in to change notification settings - Fork 3.6k
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] Fix cursor metadata compatability issue when switching the config unackedRangesOpenCacheSetEnabled #23759
base: master
Are you sure you want to change the base?
Conversation
… config unackedRangesOpenCacheSetEnabled
/pulsarbot rerun-failure-checks |
Codecov ReportAttention: Patch coverage is
Additional details and impacted files@@ Coverage Diff @@
## master #23759 +/- ##
============================================
+ Coverage 73.57% 74.13% +0.56%
+ Complexity 32624 31763 -861
============================================
Files 1877 1853 -24
Lines 139502 143391 +3889
Branches 15299 16279 +980
============================================
+ Hits 102638 106308 +3670
+ Misses 28908 28705 -203
- Partials 7956 8378 +422
Flags with carried forward coverage won't be shown. Click here to find out more.
|
if (position.getEntryId() == 0) { | ||
previousPosition = PositionFactory.create(position.getLedgerId(), -1); | ||
} else { | ||
previousPosition = ledger.getPreviousPosition(position); | ||
} |
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.
It's better to move to the internal of the getPreviousPosition() method.
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.
It's better to move to the internal of the getPreviousPosition() method.
getPreviousPosition
returns a meaningful position, in other words, it returns a position that exactly exists. And other methods rely on this feature, such as https://github.com/apache/pulsar/blob/master/managed-ledger/src/main/java/org/apache/bookkeeper/mledger/impl/ManagedLedgerImpl.java#L3621-L3623. Only cursor individual ack range does not allow crossing ledgers so far.
if (specifiedLac.getEntryId() < 0) {
// Calculate the meaningful LAC.
Position actLac = getPreviousPosition(specifiedLac);
...
}
@FieldContext( | ||
category = CATEGORY_STORAGE_ML, | ||
doc = "Whether persist cursor ack stats as long arrays, which will compress the data and reduce GC rate") | ||
private boolean managedLedgerPersistIndividualAckAsLongArray = false; |
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.
Does change the existing Pulsar 4.0 behavior when this defaults to false
?
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.
Yes, will rollback the default behavior to 3.0.x
, in other words, removed the default behavior changes that introduced by #9292
Motivation
unackedRangesOpenCacheSetEnabled
. You can reproduce the issue with the new testtestUnackmessagesAndRecoveryCompatibility
Modifications
managedLedgerPersistIndividualAckAsLongArray
to enable or disable the feature that [fix][broker] Support large number of unack message store for cursor recovery #9292 introduced, and set the default value tofalse
.Documentation
doc
doc-required
doc-not-needed
doc-complete
Matching PR in forked repository
PR in forked repository: x