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 5DCD721898 for ; Wed, 14 Aug 2019 14:31:53 -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 IsweqRQbipGt for ; Wed, 14 Aug 2019 14:31:53 -0400 (EDT) Received: from smtp5.mail.ru (smtp5.mail.ru [94.100.179.24]) (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 9E1CA2186F for ; Wed, 14 Aug 2019 14:31:52 -0400 (EDT) From: Ilya Kosarev Subject: [tarantool-patches] [PATCH] recovery: build secondary index in hot standby mode Date: Wed, 14 Aug 2019 21:31:44 +0300 Message-Id: <20190814183144.17907-1-i.kosarev@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: georgy@tarantool.org, i.kosarev@corp.mail.ru, Ilya Kosarev Secondary index was being built after reading xlog except for the force recovery case, when it was being built immediately after reading snapshot. Now it is also being built immediately after reading snapshot in case of hot standby mode in order to be ready by the time original instance quits. Closes #4135 --- Branch: https://github.com/tarantool/tarantool/tree/i.kosarev/gh-4135-secondary-index-for-hot-standby Issue: https://github.com/tarantool/tarantool/issues/4135 src/box/memtx_engine.c | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/src/box/memtx_engine.c b/src/box/memtx_engine.c index 7c3dd8465..2c8653bd9 100644 --- a/src/box/memtx_engine.c +++ b/src/box/memtx_engine.c @@ -48,6 +48,7 @@ #include "replication.h" #include "schema.h" #include "gc.h" +#include "wal.h" /* sync snapshot every 16MB */ #define SNAP_SYNC_INTERVAL (1 << 24) @@ -269,7 +270,7 @@ memtx_engine_begin_final_recovery(struct engine *engine) /* End of the fast path: loaded the primary key. */ space_foreach(memtx_end_build_primary_key, memtx); - if (!memtx->force_recovery) { + if (!memtx->force_recovery && wal_dir_lock >= 0) { /* * Fast start path: "play out" WAL * records using the primary key only, -- 2.17.1