From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from smtp10.mail.ru (smtp10.mail.ru [94.100.181.92]) (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 1CA3C4696C5 for ; Wed, 26 Feb 2020 13:00:32 +0300 (MSK) From: sergepetrenko Date: Wed, 26 Feb 2020 13:00:06 +0300 Message-Id: <071c34e71a200a996e74497ff70f75e5c5e72ec7.1582709303.git.sergepetrenko@tarantool.org> In-Reply-To: References: MIME-Version: 1.0 Content-Transfer-Encoding: 8bit Subject: [Tarantool-patches] [PATCH v4 1/4] box: expose box_is_orphan method List-Id: Tarantool development patches List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , To: kirichenkoga@gmail.com, kostja.osipov@gmail.com, v.shpilevoy@tarantool.org, alexander.turenko@tarantool.org Cc: tarantool-patches@dev.tarantool.org From: Serge Petrenko is_orphan status check is needed by applier in order to tell relay whether to send the instance's own rows back or not. Prerequisite #4739 --- src/box/box.cc | 6 ++++++ src/box/box.h | 3 +++ 2 files changed, 9 insertions(+) diff --git a/src/box/box.cc b/src/box/box.cc index 9e8311d1e..5850894de 100644 --- a/src/box/box.cc +++ b/src/box/box.cc @@ -247,6 +247,12 @@ box_is_ro(void) return is_ro || is_orphan; } +bool +box_is_orphan(void) +{ + return is_orphan; +} + int box_wait_ro(bool ro, double timeout) { diff --git a/src/box/box.h b/src/box/box.h index a212e6510..f37a945eb 100644 --- a/src/box/box.h +++ b/src/box/box.h @@ -105,6 +105,9 @@ box_set_ro(); bool box_is_ro(void); +bool +box_is_orphan(void); + /** * Wait until the instance switches to a desired mode. * \param ro wait read-only if set or read-write if unset -- 2.20.1 (Apple Git-117)