[Tarantool-patches] [PATCH v17 4/5] qsync: export more details on promote tracking
Serge Petrenko
sergepetrenko at tarantool.org
Mon Sep 27 10:00:28 MSK 2021
22.09.2021 16:05, Cyrill Gorcunov пишет:
> The patch introduces `promote` leaf to `box.info.synchro` table.
>
> | tarantool> box.info.synchro
> | ---
> | - queue:
> | len: 0
> | owner: 1
> | quorum: 1
> | promote:
> | term_max: 4
> | term_map: {1: 4}
> | ...
>
> An idea is to be able to track changes of seen requests. Since it is
> internal implementation details I prefer to not document it. Actually
> better to mark is as non-API somehow.
I think this info might be useful, so maybe document it as well?
I'd call it `journal`, probably.
box.info.synchro.journal.term - what you call term_max
box.info.synchro.journal.term_map
>
> Part-of #6036
>
> Signed-off-by: Cyrill Gorcunov <gorcunov at gmail.com>
> ---
> src/box/lua/info.c | 11 ++++++++++-
> 1 file changed, 10 insertions(+), 1 deletion(-)
>
> diff --git a/src/box/lua/info.c b/src/box/lua/info.c
> index 040af306a..144fba12d 100644
> --- a/src/box/lua/info.c
> +++ b/src/box/lua/info.c
> @@ -607,7 +607,7 @@ lbox_info_election(struct lua_State *L)
> static int
> lbox_info_synchro(struct lua_State *L)
> {
> - lua_createtable(L, 0, 2);
> + lua_createtable(L, 0, 3);
>
> /* Quorum value may be evaluated via formula */
> lua_pushinteger(L, replication_synchro_quorum);
> @@ -622,6 +622,15 @@ lbox_info_synchro(struct lua_State *L)
> lua_setfield(L, -2, "owner");
> lua_setfield(L, -2, "queue");
>
> + /* Promote related info. Suitable for debug. */
> + lua_createtable(L, 0, 2);
> + lua_pushnumber(L, queue->promote_greatest_term);
> + lua_setfield(L, -2, "term_max");
> + lua_pushstring(L, "term_map");
> + lbox_pushvclock(L, &queue->promote_term_map);
> + lua_settable(L, -3);
> + lua_setfield(L, -2, "promote");
> +
> return 1;
> }
>
--
Serge Petrenko
More information about the Tarantool-patches
mailing list