Skip to content

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

@Totktonada

Description

@Totktonada

Tarantool version: 3.5.0-entrypoint-132-g8c7cfb1cd0

Reproduce files

i.lua (same as in #11703 except one line):

#!/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) -- uncomment to easier reproduce gh-11703
        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 (same as in #11703):

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
<..wait for gh-11703 crash or send SIGINT manually..>
$ honcho start

Result

tarantool: ./src/box/box.cc:2435: int box_make_bootstrap_leader(bool): Assertion `bootstrap_strategy != BOOTSTRAP_STRATEGY_INVALID' failed.

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

tarantool/src/box/box.cc

Lines 2429 to 2448 in 8c7cfb1

int
box_make_bootstrap_leader(bool graceful)
{
/* Bootstrap strategy is read by the time instance uuid is known. */
if (!tt_uuid_is_nil(&INSTANCE_UUID) &&
bootstrap_strategy != BOOTSTRAP_STRATEGY_SUPERVISED) {
assert(bootstrap_strategy != BOOTSTRAP_STRATEGY_INVALID);
diag_set(ClientError, ER_UNSUPPORTED,
tt_sprintf("bootstrap_strategy = '%s'",
cfg_gets("bootstrap_strategy")),
"promoting the bootstrap leader via "
"box.ctl.make_bootstrap_leader()");
return -1;
}
if (graceful)
return box_make_bootstrap_leader_graceful();
else
return box_make_bootstrap_leader_nongraceful();
}

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