CQs: fix a read_rom_q_tail/4 crash when tune_read/2 rounds past end_seq_id#15595
Conversation
read_rom_q_tail/4 crash when tune_read/2 rounds past end_seq_id`
read_rom_q_tail/4 crash when tune_read/2 rounds past end_seq_id`read_rom_q_tail/4 crash when tune_read/2 rounds past end_seq_id`
|
Checking. |
|
Could you provide me with the crash log for this? Both to confirm the fix and to write a regression test case. |
|
@lhoguin I will dig in, they were logs from last Friday. |
|
Below a standard CT The failure can be seen in |
read_rom_q_tail/4 crash when tune_read/2 rounds past end_seq_id`read_rom_q_tail/4 crash when tune_read/2 rounds past end_seq_id
|
Thank you. I can reproduce. |
a2a3d6e to
e04f6cb
Compare
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.
e04f6cb to
ccb1e48
Compare
|
I have amended and pushed the change. I added a regression test based on the CT logs and tweaked the code, notably removing the check in the second clause because it is already covered by |
(cherry picked from commit f43a079)
(cherry picked from commit 0934fa5)
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.
CQs: fix a `read_rom_q_tail/4` crash when `tune_read/2` rounds past `end_seq_id` (backport #15595)
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.