[Tarantool-patches] [PATCH v17 4/5] qsync: export more details on promote tracking
Cyrill Gorcunov
gorcunov at gmail.com
Wed Sep 22 16:05:34 MSK 2021
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.
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;
}
--
2.31.1
More information about the Tarantool-patches
mailing list