[Tarantool-patches] [PATCH v4 12/16] box: fix an assertion failure after a spurious wakeup in promote
Vladislav Shpilevoy
v.shpilevoy at tarantool.org
Thu Jul 22 02:29:14 MSK 2021
I appreciate the work you did here!
See 2 comments below.
> diff --git a/test/replication/gh-3055-promote-wakeup-crash.result b/test/replication/gh-3055-promote-wakeup-crash.result
> new file mode 100644
> index 000000000..e508611e5
> --- /dev/null
> +++ b/test/replication/gh-3055-promote-wakeup-crash.result
> @@ -0,0 +1,43 @@
> +-- test-run result file version 2
> +test_run = require('test_run').new()
> + | ---
> + | ...
> +--
> +-- gh-3055 follow-up: box.ctl.promote() could crash on an assertion after a
> +-- spurious wakeup.
> +--
> +_ = box.space._cluster:insert{2, require('uuid').str()}
> + | ---
> + | ...
> +box.cfg{election_mode='manual',\
> + replication_synchro_quorum=2,\
> + election_timeout=1000}
1. Shouldn't you save and restore the old option values in the end
of the test?
> + | ---
> + | ...
> +
> +fiber = require('fiber')
> + | ---
> + | ...
> +f = fiber.create(function() box.ctl.promote() end)
> + | ---
> + | ...
> +f:set_joinable(true)
2. But you never use :join(). Perhaps you might want to call it
after :cancel(). To ensure the fiber really ended.
> + | ---
> + | ...
> +f:wakeup()
> + | ---
> + | ...
> +fiber.yield()
> + | ---
> + | ...
> +
> +-- Cleanup.
> +f:cancel()
> + | ---
> + | ...
> +box.cfg{election_mode='off'}
> + | ---
> + | ...
> +test_run:cleanup_cluster()
> + | ---
> + | ...
More information about the Tarantool-patches
mailing list