Skip to content

replication: update raft instance id on anon replica register#11940

Merged
sergepetrenko merged 1 commit intotarantool:masterfrom
sergepetrenko:gh-11938-stale-raft-instance-id
Oct 16, 2025
Merged

replication: update raft instance id on anon replica register#11940
sergepetrenko merged 1 commit intotarantool:masterfrom
sergepetrenko:gh-11938-stale-raft-instance-id

Conversation

@sergepetrenko
Copy link
Collaborator

The raft subsystem has its own copy of an instance id, raft::self. It's set during initial box.cfg() call, after local recovery or bootstrap.

It was forgotten to update raft::self after an anonymous replica register. This could lead to various assertion failures in raft code in debug build, and in the release build the raft state would be silently corrupted. Fix this.

Closes #11938

NO_DOC=bugfix

@sergepetrenko sergepetrenko requested a review from a team as a code owner October 15, 2025 16:46
@sergepetrenko sergepetrenko added backport/2.11 Automatically create a 2.11 backport PR 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 labels Oct 15, 2025
@sergepetrenko sergepetrenko force-pushed the gh-11938-stale-raft-instance-id branch 2 times, most recently from a392fd6 to 9d1d692 Compare October 15, 2025 17:15
Copy link
Collaborator

@Gerold103 Gerold103 left a comment

Choose a reason for hiding this comment

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

Oh, what a miss! Lucky it was found. But also means that the anon replicas don't seem to be used much by the users together with the synchronous replication.

@sergepetrenko sergepetrenko force-pushed the gh-11938-stale-raft-instance-id branch 2 times, most recently from 7f9f18d to a554635 Compare October 15, 2025 18:39
@sergepetrenko sergepetrenko self-assigned this Oct 15, 2025
@coveralls
Copy link

coveralls commented Oct 15, 2025

Coverage Status

coverage: 87.628% (-0.02%) from 87.645%
when pulling 54b617d on sergepetrenko:gh-11938-stale-raft-instance-id
into d3830b9
on tarantool:master
.

@sergepetrenko sergepetrenko added the full-ci Enables all tests for a pull request label Oct 16, 2025
@sergepetrenko sergepetrenko removed the full-ci Enables all tests for a pull request label Oct 16, 2025
The raft subsystem has its own copy of an instance id, raft::self. It's
set during initial `box.cfg()` call, after local recovery or bootstrap.

It was forgotten to update raft::self after an anonymous replica
register. This could lead to various assertion failures in raft code in
debug build, and in the release build the raft state would be silently
corrupted. Fix this.

Closes tarantool#11938

NO_DOC=bugfix
@sergepetrenko sergepetrenko force-pushed the gh-11938-stale-raft-instance-id branch from 6fdd647 to 54b617d Compare October 16, 2025 11:11
@sergepetrenko sergepetrenko merged commit a4d038d into tarantool:master Oct 16, 2025
27 checks passed
@TarantoolBot
Copy link
Collaborator

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

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

git fetch origin release/2.11
git worktree add -d .worktree/backport/release/2.11/11940 origin/release/2.11
cd .worktree/backport/release/2.11/11940
git switch --create backport/release/2.11/11940
git cherry-pick -x a4d038dcdd2c52f710226e4bcd963d20f05b9e8a

@TarantoolBot
Copy link
Collaborator

Successfully created backport PR for release/3.2:

@TarantoolBot
Copy link
Collaborator

Successfully created backport PR for release/3.3:

@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/2.11 Automatically create a 2.11 backport PR 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.

Assertion failure and inconsistent Raft state after replica transitions from anonymous

5 participants