Skip to content

Commit d6e9b1e

Browse files
poorbarcodeTechnoboy-nodece
authored andcommitted
[improve][broker]Skip to mark delete if the target position of expira… (apache#24881)
Co-authored-by: Jiwei Guo <[email protected]> Co-authored-by: Zixuan Liu <[email protected]> (cherry picked from commit 14b0821) (cherry picked from commit 5bdc5aa)
1 parent 34628a9 commit d6e9b1e

File tree

1 file changed

+4
-0
lines changed

1 file changed

+4
-0
lines changed

pulsar-broker/src/main/java/org/apache/pulsar/broker/service/persistent/PersistentMessageExpiryMonitor.java

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -232,6 +232,10 @@ public void markDeleteFailed(ManagedLedgerException exception, Object ctx) {
232232
@Override
233233
public void findEntryComplete(Position position, Object ctx) {
234234
if (position != null) {
235+
var markDeletedPosition = cursor.getMarkDeletedPosition();
236+
if (markDeletedPosition != null && markDeletedPosition.compareTo(position) >= 0) {
237+
return;
238+
}
235239
log.info("[{}][{}] Expiring all messages until position {}", topicName, subName, position);
236240
Position prevMarkDeletePos = cursor.getMarkDeletedPosition();
237241
cursor.asyncMarkDelete(position, cursor.getProperties(), markDeleteCallback,

0 commit comments

Comments
 (0)