Skip to content

replication: fix wrong assumption in box.ctl.make_bootstrap_leader#11862

Merged
sergepetrenko merged 1 commit intotarantool:masterfrom
CuriousGeorgiy:gh-11704-graceful-bootstrap-race
Oct 10, 2025
Merged

replication: fix wrong assumption in box.ctl.make_bootstrap_leader#11862
sergepetrenko merged 1 commit intotarantool:masterfrom
CuriousGeorgiy:gh-11704-graceful-bootstrap-race

Conversation

@CuriousGeorgiy
Copy link
Member

This patch fixes a wrong assumption about bootstrap during recovery in box.ctl.make_bootstrap_leader.

Closes #11704

@CuriousGeorgiy CuriousGeorgiy requested a review from a team as a code owner September 29, 2025 13:16
@CuriousGeorgiy CuriousGeorgiy force-pushed the gh-11704-graceful-bootstrap-race branch from c3f6737 to 43be698 Compare September 29, 2025 13:26
@coveralls
Copy link

coveralls commented Sep 29, 2025

Coverage Status

coverage: 87.611% (-0.02%) from 87.633%
when pulling c682a98 on CuriousGeorgiy:gh-11704-graceful-bootstrap-race
into 940559a
on tarantool:master
.

Copy link
Collaborator

@sergepetrenko sergepetrenko left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thanks for the patch!

Copy link
Member

@georgiy-belyanin georgiy-belyanin left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I have tested it with the corresponding logic inside the Tarantool failover coordinator and it seems OK. Thank you for working on it.

@georgiy-belyanin georgiy-belyanin removed their assignment Sep 30, 2025
@CuriousGeorgiy CuriousGeorgiy force-pushed the gh-11704-graceful-bootstrap-race branch from 43be698 to 599b991 Compare October 6, 2025 14:12
`box_make_bootstrap_leader` assumes that by the time the instance UID is
assigned, the bootstrap strategy is also assigned. However, this assumption
does not hold during recovery, since the instance UID is assigned during
engine recovery from the snapshot at an earlier stage of recovery, and the
fiber executing `box.cfg` yields because of `iproto_do_cfg` before the
bootstrap strategy is set.

To fix this, let's throw an error iff the bootstrap strategy is set, and it
is not `supervised`.

Closes tarantool#11704

NO_DOC=<bugfix>
@sergepetrenko sergepetrenko force-pushed the gh-11704-graceful-bootstrap-race branch from 599b991 to c682a98 Compare October 10, 2025 07:30
Copy link
Collaborator

@sergepetrenko sergepetrenko left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thanks!
LGTM.

@CuriousGeorgiy CuriousGeorgiy added the full-ci Enables all tests for a pull request label Oct 10, 2025
@sergepetrenko sergepetrenko added backport/3.2 Automatically create a 3.2 backport PR backport/3.3 Automatically create a 3.3 backport PR backport/3.4 Automatically create a 3.4 backport PR backport/3.5 Automatically create a 3.5 backport PR and removed full-ci Enables all tests for a pull request labels Oct 10, 2025
@sergepetrenko sergepetrenko merged commit c5ca705 into tarantool:master Oct 10, 2025
102 of 104 checks passed
@TarantoolBot
Copy link
Collaborator

Backport failed for release/3.2, because it was unable to cherry-pick the commit(s).

Please cherry-pick the changes locally and resolve any conflicts.

git fetch origin release/3.2
git worktree add -d .worktree/backport/release/3.2/11862 origin/release/3.2
cd .worktree/backport/release/3.2/11862
git switch --create backport/release/3.2/11862
git cherry-pick -x c5ca705e5710afb85335d25355af9f535c03123a

@TarantoolBot
Copy link
Collaborator

Backport failed for release/3.3, because it was unable to cherry-pick the commit(s).

Please cherry-pick the changes locally and resolve any conflicts.

git fetch origin release/3.3
git worktree add -d .worktree/backport/release/3.3/11862 origin/release/3.3
cd .worktree/backport/release/3.3/11862
git switch --create backport/release/3.3/11862
git cherry-pick -x c5ca705e5710afb85335d25355af9f535c03123a

@TarantoolBot
Copy link
Collaborator

Successfully created backport PR for release/3.4:

@TarantoolBot
Copy link
Collaborator

Successfully created backport PR for release/3.5:

@TarantoolBot
Copy link
Collaborator

Backport summary

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

Labels

backport/3.2 Automatically create a 3.2 backport PR backport/3.3 Automatically create a 3.3 backport PR backport/3.4 Automatically create a 3.4 backport PR backport/3.5 Automatically create a 3.5 backport PR

Projects

None yet

Development

Successfully merging this pull request may close these issues.

replication: box.ctl.make_bootstrap_leader() fails with assertion

6 participants