[improve][broker]Skip to mark delete if the target position of expira… - #24881
Conversation
…tion is less than mark deleted position
|
/pulsarbot rerun-failure-checks |
…ersistent/PersistentMessageExpiryMonitor.java Co-authored-by: Zixuan Liu <nodeces@gmail.com>
|
/pulsarbot rerun-failure-checks |
#24881) Co-authored-by: Jiwei Guo <jwguo@streamnative.io> Co-authored-by: Zixuan Liu <nodeces@gmail.com>
apache#24881) Co-authored-by: Jiwei Guo <jwguo@streamnative.io> Co-authored-by: Zixuan Liu <nodeces@gmail.com> (cherry picked from commit 14b0821) (cherry picked from commit 5bdc5aa)
| public void findEntryComplete(Position position, Object ctx) { | ||
| if (position != null) { | ||
| var markDeletedPosition = cursor.getMarkDeletedPosition(); | ||
| if (markDeletedPosition != null && markDeletedPosition.compareTo(position) >= 0) { |
There was a problem hiding this comment.
@poorbarcode This seems to miss expirationCheckInProgress = FALSE;. Could you please check?
There was a problem hiding this comment.
The variable will be finally set to false after the task is completely finished(after mark deleting task is finished), see also this two lines:
- https://github.com/apache/pulsar/blob/v4.1.1/pulsar-broker/src/main/java/org/apache/pulsar/broker/service/persistent/PersistentMessageExpiryMonitor.java#L217
- https://github.com/apache/pulsar/blob/v4.1.1/pulsar-broker/src/main/java/org/apache/pulsar/broker/service/persistent/PersistentMessageExpiryMonitor.java#L226
There was a problem hiding this comment.
The variable will be finally set to after the task is completely finished(after mark deleting task is finished), see also this two lines:
Please check again. markDeleteCallback won't get executed at all after the new code in this PR has been added.
There was a problem hiding this comment.
I created #24941 to fix the bug and it also contains a test case
|
There's a follow up in #24941 which fixes a bug introduced by this PR |
apache#24881) Co-authored-by: Jiwei Guo <jwguo@streamnative.io> Co-authored-by: Zixuan Liu <nodeces@gmail.com> (cherry picked from commit 14b0821) (cherry picked from commit 5bdc5aa)
Motivation
#24622 improved the message expiration, but forgot to skip expiring if the target position is less than mark deleted position
Modifications
Improve the behaviour
Documentation
docdoc-requireddoc-not-neededdoc-completeMatching PR in forked repository
PR in forked repository: x