Tarantool development patches archive
 help / color / mirror / Atom feed
From: Vladimir Davydov <vdavydov.dev@gmail.com>
To: kostja@tarantool.org
Cc: tarantool-patches@freelists.org
Subject: [PATCH 10/13] gc: improve box.info.gc output
Date: Thu,  4 Oct 2018 20:20:12 +0300	[thread overview]
Message-ID: <ec26d1d0a8c80d0653ac557b162aeeba1a35d7ca.1538671546.git.vdavydov.dev@gmail.com> (raw)
In-Reply-To: <cover.1538671546.git.vdavydov.dev@gmail.com>
In-Reply-To: <cover.1538671546.git.vdavydov.dev@gmail.com>

Report vclocks in addition to signatures. When box.info.gc was first
introduced we used signatures in gc. Now we use vclocks so there's no
reason not to report them. This is consistent with box.info output
(there's vclock and signature).

Report the vclock and signature of the oldest WAL row available on the
instance under box.info.gc().vclock. Without this information the user
would have to figure it out by looking at box.info.gc().consumers.
---
 src/box/lua/info.c | 20 ++++++++++++++++++--
 1 file changed, 18 insertions(+), 2 deletions(-)

diff --git a/src/box/lua/info.c b/src/box/lua/info.c
index 97d5aba3..9e51b823 100644
--- a/src/box/lua/info.c
+++ b/src/box/lua/info.c
@@ -365,13 +365,25 @@ lbox_info_gc_call(struct lua_State *L)
 
 	lua_newtable(L);
 
+	lua_pushstring(L, "vclock");
+	lbox_pushvclock(L, &gc.vclock);
+	lua_settable(L, -3);
+
+	lua_pushstring(L, "signature");
+	luaL_pushint64(L, vclock_sum(&gc.vclock));
+	lua_settable(L, -3);
+
 	lua_pushstring(L, "checkpoints");
 	lua_newtable(L);
 
 	count = 0;
 	struct gc_checkpoint *checkpoint;
 	gc_foreach_checkpoint(checkpoint) {
-		lua_createtable(L, 0, 1);
+		lua_createtable(L, 0, 2);
+
+		lua_pushstring(L, "vclock");
+		lbox_pushvclock(L, &checkpoint->vclock);
+		lua_settable(L, -3);
 
 		lua_pushstring(L, "signature");
 		luaL_pushint64(L, vclock_sum(&checkpoint->vclock));
@@ -390,12 +402,16 @@ lbox_info_gc_call(struct lua_State *L)
 	count = 0;
 	struct gc_consumer *consumer;
 	while ((consumer = gc_consumer_iterator_next(&consumers)) != NULL) {
-		lua_createtable(L, 0, 2);
+		lua_createtable(L, 0, 3);
 
 		lua_pushstring(L, "name");
 		lua_pushstring(L, consumer->name);
 		lua_settable(L, -3);
 
+		lua_pushstring(L, "vclock");
+		lbox_pushvclock(L, &consumer->vclock);
+		lua_settable(L, -3);
+
 		lua_pushstring(L, "signature");
 		luaL_pushint64(L, vclock_sum(&consumer->vclock));
 		lua_settable(L, -3);
-- 
2.11.0

  parent reply	other threads:[~2018-10-04 17:20 UTC|newest]

Thread overview: 30+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2018-10-04 17:20 [PATCH 00/13] box: garbage collection refactoring and fixes Vladimir Davydov
2018-10-04 17:20 ` [PATCH 01/13] vinyl: fix master crash on replica join failure Vladimir Davydov
2018-10-04 21:43   ` Konstantin Osipov
2018-10-04 17:20 ` [PATCH 02/13] vinyl: force deletion of runs left from unfinished indexes on restart Vladimir Davydov
2018-10-04 21:44   ` Konstantin Osipov
2018-10-04 17:20 ` [PATCH 03/13] gc: make gc_consumer and gc_state structs transparent Vladimir Davydov
2018-10-04 21:47   ` Konstantin Osipov
2018-10-04 17:20 ` [PATCH 04/13] gc: use fixed length buffer for storing consumer name Vladimir Davydov
2018-10-04 21:47   ` Konstantin Osipov
2018-10-04 17:20 ` [PATCH 05/13] gc: fold gc_consumer_new and gc_consumer_delete Vladimir Davydov
2018-10-04 21:50   ` Konstantin Osipov
2018-10-05  8:56     ` Vladimir Davydov
2018-10-04 17:20 ` [PATCH 06/13] gc: format consumer name in gc_consumer_register Vladimir Davydov
2018-10-04 21:50   ` Konstantin Osipov
2018-10-04 17:20 ` [PATCH 07/13] gc: rename checkpoint_count to min_checkpoint_count Vladimir Davydov
2018-10-04 21:51   ` Konstantin Osipov
2018-10-04 17:20 ` [PATCH 08/13] gc: keep track of available checkpoints Vladimir Davydov
2018-10-04 21:59   ` Konstantin Osipov
2018-10-05  8:50     ` Vladimir Davydov
2018-10-04 17:20 ` [PATCH 09/13] gc: cleanup garbage collection procedure Vladimir Davydov
2018-10-04 22:00   ` Konstantin Osipov
2018-10-04 17:20 ` Vladimir Davydov [this message]
2018-10-04 22:01   ` [PATCH 10/13] gc: improve box.info.gc output Konstantin Osipov
2018-10-04 17:20 ` [PATCH 11/13] gc: separate checkpoint references from wal consumers Vladimir Davydov
2018-10-04 22:05   ` Konstantin Osipov
2018-10-04 17:20 ` [PATCH 12/13] gc: call gc_run unconditionally when consumer is advanced Vladimir Davydov
2018-10-04 22:26   ` Konstantin Osipov
2018-10-04 17:20 ` [PATCH 13/13] replication: ref checkpoint needed to join replica Vladimir Davydov
2018-10-04 22:27   ` Konstantin Osipov
2018-10-05 17:03 ` [PATCH 00/13] box: garbage collection refactoring and fixes Vladimir Davydov

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=ec26d1d0a8c80d0653ac557b162aeeba1a35d7ca.1538671546.git.vdavydov.dev@gmail.com \
    --to=vdavydov.dev@gmail.com \
    --cc=kostja@tarantool.org \
    --cc=tarantool-patches@freelists.org \
    --subject='Re: [PATCH 10/13] gc: improve box.info.gc output' \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox