CQs: fix a read_rom_q_tail/4 crash when tune_read/2 rounds past end_seq_id (backport #15595)#15620
Merged
michaelklishin merged 5 commits intov4.2.xfrom Mar 3, 2026
Merged
Conversation
During recovery when all transient messages are dropped
the code could crash because the #q_tail{} resulting
from reading messages into memory had a start seqid
higher than the end seqid, due to tune_read rounding
up the read range past segment boundaries and the code
not noticing it went above the end seqid.
(cherry picked from commit ccb1e48)
# Conflicts:
# deps/rabbit/src/rabbit_variable_queue.erl
(cherry picked from commit f43a079)
(cherry picked from commit 63c965e)
(cherry picked from commit 0934fa5)
Author
|
Cherry-pick of ccb1e48 has failed: To fix up this pull request, you can check it out locally. See documentation: https://docs.github.com/en/pull-requests/collaborating-with-pull-requests/reviewing-changes-in-pull-requests/checking-out-pull-requests-locally |
Note that on v4.2.x, the general problem is still present but under different conditions, namely DeltaSeqId1 =:= DeltaSeqIdEnd. Unlike in `main`, DeltaSeqIdEnd cannot read past DeltaSeqId.
Collaborator
|
The |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
tune_read/2may round up the read range to a segment boundary, advancingstart_seq_idpastend_seq_id. Guard against this in both branches ofread_from_q_tail;4.This scenario was detected by a sporadic failure in
classic_queue_prop_SUITEwhich now passes 200 times in a row.This is an automatic backport of pull request #15595 done by Mergify.