Skip to content

Fix WAITAOF mix-use last_offset and last_numreplicas#11922

Merged
oranagra merged 2 commits intoredis:unstablefrom
enjoy-binbin:fix_waitaof_offset
Mar 15, 2023
Merged

Fix WAITAOF mix-use last_offset and last_numreplicas#11922
oranagra merged 2 commits intoredis:unstablefrom
enjoy-binbin:fix_waitaof_offset

Conversation

@enjoy-binbin
Copy link
Contributor

There be a situation that satisfies WAIT, and then wrongly unblock
WAITAOF because we mix-use last_offset and last_numreplicas.

We update last_offset and last_numreplicas only when the condition
matches. i.e. output of either replicationCountAOFAcksByOffset or
replicationCountAcksByOffset is right.

In this case, we need to have separate last_ variables for each of
them. Added a last_aof_offset and last_aof_numreplicas for WAITAOF.

WAITAOF was added in #11713. Found while coding #11917.
A Test was added to validate that case.

There be a situation that satisfies WAIT, and then wrongly unblock
WAITAOF because we mix-use last_offset and last_numreplicas.

We update last_offset and last_numreplicas only when the condition
matches. i.e. output of either replicationCountAOFAcksByOffset or
replicationCountAcksByOffset is right.

In this case, we need to have separate last_ variables for each of
them. Added a last_aof_offset and last_aof_numreplicas for WAITAOF.

WAITAOF was added in redis#11713. Found while coding redis#11917.
A Test was added to validate that case.
@enjoy-binbin enjoy-binbin requested a review from oranagra March 15, 2023 12:55
@oranagra oranagra merged commit 58285a6 into redis:unstable Mar 15, 2023
@enjoy-binbin enjoy-binbin deleted the fix_waitaof_offset branch March 15, 2023 16:16
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants