Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

QQ: resend pending commands when new leader detected on applied notif… #13095

Merged
merged 1 commit into from
Jan 22, 2025

Conversation

kjnilsson
Copy link
Contributor

@kjnilsson kjnilsson commented Jan 17, 2025

…ication.

When a leader changes all enqueuer and consumer processes are notified from the state_enter(leader, callback. However a new leader may not yet have applied all commands that the old leader had. If any of those commands is a checkout or a register_enqueuer command these processes will not be notified of the new leader and thus may never resend their pending commands.

The new leader will however send an applied notification when it does apply these entries and these are always sent from the leader process so can also be used to trigger pending resends. This commit implements that.

Most likely fixes the jepsen failure in https://github.com/rabbitmq/jepsen/actions/runs/12606905118 - however proving this could be extremely difficult.

@kjnilsson kjnilsson added this to the 4.0.6 milestone Jan 17, 2025
@kjnilsson kjnilsson force-pushed the qq-resend-pending-commands-on-applied branch from 4aba0d2 to 8c8df9e Compare January 17, 2025 12:09
@kjnilsson kjnilsson marked this pull request as draft January 17, 2025 12:40
@kjnilsson kjnilsson force-pushed the qq-resend-pending-commands-on-applied branch from 8c8df9e to fd4f580 Compare January 17, 2025 12:49
@kjnilsson kjnilsson marked this pull request as ready for review January 22, 2025 09:24
@kjnilsson kjnilsson force-pushed the qq-resend-pending-commands-on-applied branch 2 times, most recently from 9d7a35a to e26b0e6 Compare January 22, 2025 10:05
@ansd ansd self-requested a review January 22, 2025 10:26
@kjnilsson kjnilsson force-pushed the qq-resend-pending-commands-on-applied branch from e26b0e6 to 6d417bf Compare January 22, 2025 11:43
…ication.

When a leader changes all enqueuer and consumer processes are notified
from the `state_enter(leader,` callback. However a new leader may not
yet have applied all commands that the old leader had. If any of those
commands is a checkout or a register_enqueuer command these processes
will not be notified of the new leader and thus may never resend their
pending commands.

The new leader will however send an applied notification when it does
apply these entries and these are always sent from the leader process
so can also be used to trigger pending resends. This commit implements
that.
@kjnilsson kjnilsson force-pushed the qq-resend-pending-commands-on-applied branch from 6d417bf to d31b9aa Compare January 22, 2025 13:38
@kjnilsson kjnilsson merged commit 2f89bd9 into main Jan 22, 2025
271 of 272 checks passed
@kjnilsson kjnilsson deleted the qq-resend-pending-commands-on-applied branch January 22, 2025 19:43
michaelklishin added a commit that referenced this pull request Jan 22, 2025
QQ: resend pending commands when new leader detected on applied notif… (backport #13095)
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants