From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from localhost (localhost [127.0.0.1]) by turing.freelists.org (Avenir Technologies Mail Multiplex) with ESMTP id EA9FA2BA43 for ; Tue, 16 Oct 2018 06:11:11 -0400 (EDT) Received: from turing.freelists.org ([127.0.0.1]) by localhost (turing.freelists.org [127.0.0.1]) (amavisd-new, port 10024) with ESMTP id rvrGEpcI8YrN for ; Tue, 16 Oct 2018 06:11:11 -0400 (EDT) Received: from smtp51.i.mail.ru (smtp51.i.mail.ru [94.100.177.111]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by turing.freelists.org (Avenir Technologies Mail Multiplex) with ESMTPS id 54DF82B9CD for ; Tue, 16 Oct 2018 06:11:11 -0400 (EDT) From: Serge Petrenko Subject: [tarantool-patches] [PATCH] [replication] make join stage more informative Date: Tue, 16 Oct 2018 13:10:53 +0300 Message-Id: <20181016101053.21594-1-sergepetrenko@tarantool.org> Sender: tarantool-patches-bounce@freelists.org Errors-to: tarantool-patches-bounce@freelists.org Reply-To: tarantool-patches@freelists.org List-help: List-unsubscribe: List-software: Ecartis version 1.0.0 List-Id: tarantool-patches List-subscribe: List-owner: List-post: List-archive: To: tarantool-patches@freelists.org Cc: Serge Petrenko This patch adds logging amount of rows recieved by applier during the join stage, the same way that recovery has it. It also adds downstream: status: joining message to master's box.info.replication for a replica that is joining. Closes #3165 --- https://github.com/tarantool/tarantool/issues/3165 https://github.com/tarantool/tarantool/tree/sp/gh-3165-join-progress-report src/box/applier.cc | 7 +++++++ src/box/lua/info.c | 9 +++++++-- 2 files changed, 14 insertions(+), 2 deletions(-) diff --git a/src/box/applier.cc b/src/box/applier.cc index 7da278e68..ba68c3d07 100644 --- a/src/box/applier.cc +++ b/src/box/applier.cc @@ -309,11 +309,15 @@ applier_join(struct applier *applier) * Receive initial data. */ assert(applier->join_stream != NULL); + uint64_t row_count = 0; while (true) { coio_read_xrow(coio, ibuf, &row); applier->last_row_time = ev_monotonic_now(loop()); if (iproto_type_is_dml(row.type)) { xstream_write_xc(applier->join_stream, &row); + ++row_count; + if (row_count % 100000 == 0) + say_info("%.1fM rows recieved", row_count / 1e6); } else if (row.type == IPROTO_OK) { if (applier->version_id < version_id(1, 7, 0)) { /* @@ -354,6 +358,9 @@ applier_join(struct applier *applier) if (iproto_type_is_dml(row.type)) { vclock_follow_xrow(&replicaset.vclock, &row); xstream_write_xc(applier->subscribe_stream, &row); + ++row_count; + if (row_count % 100000 == 0) + say_info("%.1fM rows recieved", row_count / 1e6); } else if (row.type == IPROTO_OK) { /* * Current vclock. This is not used now, diff --git a/src/box/lua/info.c b/src/box/lua/info.c index 655768ec4..4c25255c0 100644 --- a/src/box/lua/info.c +++ b/src/box/lua/info.c @@ -119,8 +119,13 @@ static void lbox_pushrelay(lua_State *L, struct relay *relay) { lua_newtable(L); - lua_pushstring(L, "vclock"); - lbox_pushvclock(L, relay_vclock(relay)); + if (relay_vclock(relay)->map == 0) { + lua_pushstring(L, "status"); + lua_pushstring(L, "joining"); + } else { + lua_pushstring(L, "vclock"); + lbox_pushvclock(L, relay_vclock(relay)); + } lua_settable(L, -3); } -- 2.17.1 (Apple Git-112)