Skip to content

Clean up individually deleted messages before the mark-delete position - #14261

Merged
merlimat merged 1 commit into
apache:masterfrom
merlimat:individually-deleted-messages-out-of-sync
Feb 14, 2022
Merged

Clean up individually deleted messages before the mark-delete position#14261
merlimat merged 1 commit into
apache:masterfrom
merlimat:individually-deleted-messages-out-of-sync

Conversation

@merlimat

Copy link
Copy Markdown
Contributor

Motivation

If there are individually deleted messages that are pointing to before the mark-delete position, that will cause a situation in which the cursor.delete() calls will fail to move the mark-delete position anymore (at least until an explicit cursor.markDelete() is called).

The problem is that we are comparing the upper-value of the first range and if that is lower, it would be trying to mark-delete an earlier position and get error.

@merlimat merlimat added type/bug The PR fixed a bug or issue reported a bug doc-not-needed Your PR changes do not impact docs release/2.9.3 release/2.8.4 labels Feb 14, 2022
@merlimat merlimat added this to the 2.10.0 milestone Feb 14, 2022
@merlimat merlimat self-assigned this Feb 14, 2022
@merlimat
merlimat merged commit 6d717a0 into apache:master Feb 14, 2022
@merlimat
merlimat deleted the individually-deleted-messages-out-of-sync branch February 14, 2022 05:50
@merlimat merlimat added cherry-picked/branch-2.8 Archived: 2.8 is end of life cherry-picked/branch-2.9 Archived: 2.9 is end of life labels Feb 14, 2022
@lhotari

lhotari commented Feb 14, 2022

Copy link
Copy Markdown
Member

This fix reminds me of the issue I was seeing in #10054 with replicated subscriptions. In that case, it seems that because of the "marker messages" being acknowledged automatically, the messages get deleted out of order in all cases where the consumer doesn't keep up with the producer. This explains the individuallyDeletedMessages ranges seen when the problem occurs in #10054. When there are individuallyDeletedMessages in the subscription, the markDeletedPosition doesn't get updated and therefore the subscription state doesn't get replicated.
@merlimat could this PR help resolve the above scenario?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

area/broker cherry-picked/branch-2.7 Archived: 2.7 is end of life cherry-picked/branch-2.8 Archived: 2.8 is end of life cherry-picked/branch-2.9 Archived: 2.9 is end of life doc-not-needed Your PR changes do not impact docs release/2.7.5 release/2.8.3 release/2.9.2 type/bug The PR fixed a bug or issue reported a bug

Projects

None yet

Development

Successfully merging this pull request may close these issues.

6 participants