From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from smtp42.i.mail.ru (smtp42.i.mail.ru [94.100.177.102]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by dev.tarantool.org (Postfix) with ESMTPS id 8FD51469710 for ; Wed, 25 Nov 2020 00:03:15 +0300 (MSK) From: Nikita Pettik Date: Wed, 25 Nov 2020 00:03:11 +0300 Message-Id: <073615333a88cf9ccf217ad90b121cd5074eddd9.1606251521.git.korablev@tarantool.org> Subject: [Tarantool-patches] [PATCH] vinyl: account statement statistics during .index rebuild List-Id: Tarantool development patches List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , To: tarantool-patches@dev.tarantool.org Cc: v.shpilevoy@tarantool.org It may turn out to be necessary to re-create .index file corresponding to .run file. During rebuild it was forgotten to account statement statistics, i.e. count of INSERTs, DELETEs etc. Let's fix it and patch vy_run_rebuild_index(). --- Branch: https://github.com/tarantool/tarantool/tree/np/vy-account-stmt-stat-on-index-rebuild N.B. problem is obvious and trivial to fix. However, test for it is likely to be way more sophisticated, so I haven't included it (but checked manually that everything works fine). src/box/vy_run.c | 2 ++ 1 file changed, 2 insertions(+) diff --git a/src/box/vy_run.c b/src/box/vy_run.c index b9822dc3e..820a6ce3f 100644 --- a/src/box/vy_run.c +++ b/src/box/vy_run.c @@ -2452,6 +2452,8 @@ vy_run_rebuild_index(struct vy_run *run, const char *dir, goto close_err; } } + vy_stmt_stat_acct(&run->info.stmt_stat, + vy_stmt_type(tuple)); key = vy_stmt_is_key(tuple) ? tuple_data(tuple) : tuple_extract_key(tuple, cmp_def, MULTIKEY_NONE, NULL); -- 2.17.1