Skip to content

replication: initial promote attempt after bootstrap leads to assertion failure #11703

@Totktonada

Description

@Totktonada

Tarantool version: 3.5.0-entrypoint-132-g8c7cfb1cd0

Reproduce files

i.lua:

#!/usr/bin/env tarantool

local fio = require('fio')
local fiber = require('fiber')

local port = tonumber(arg[1])
assert(port ~= nil, port)
fio.mkdir(port)
if port == 3301 then
    fiber.new(function()
        fiber.sleep(2)
        box.ctl.make_bootstrap_leader({graceful = true})
        while box.info.status ~= 'running' do
            fiber.sleep(0.001)
        end
        box.ctl.promote()
        box.cfg({read_only = false})
        box.ctl.wait_rw()
        box.schema.user.grant('guest', 'super')
    end)
end
box.cfg({
    read_only = true,
    work_dir = tostring(port),
    listen = port,
    replication = {3301, 3302, 3303},
    election_mode = 'manual',
    bootstrap_strategy = 'supervised',
})

Procfile:

i-3301: ./src/tarantool i.lua 3301
i-3302: ./src/tarantool i.lua 3302
i-3303: ./src/tarantool i.lua 3303

Reproduce steps

$ rm -r 3301 3302 3303
$ honcho start

Result

tarantool: ./src/box/box.cc:6286: void box_cfg_xc(): Assertion `rc == 0' failed.

The relevant code (the assertion is on the 6286 line):

tarantool/src/box/box.cc

Lines 6265 to 6288 in 8c7cfb1

if (!is_bootstrap_leader) {
replicaset_sync();
} else if (box_election_mode == ELECTION_MODE_CANDIDATE ||
box_election_mode == ELECTION_MODE_MANUAL) {
/*
* When the cluster is just bootstrapped and this instance is a
* leader, it makes no sense to wait for a leader appearance.
* There is no one. Moreover this node *is* a leader, so it
* should take the control over the situation and start a new
* term immediately.
*/
int rc = box_raft_try_promote();
if (raft->leader != instance_id && raft->leader != 0) {
/*
* It was promoted and is a single registered node -
* there can't be another leader or a new term bump.
*/
panic("Bootstrap master couldn't elect self as a "
"leader. Leader is %u, term is %llu",
raft->leader, (long long)raft->volatile_term);
}
assert(rc == 0);
(void)rc;
}

Metadata

Metadata

Labels

3.2Target is 3.2 and all newer release/master branchesbugSomething isn't workingcrashreplication

Type

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions