From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from mail-lj1-f194.google.com (mail-lj1-f194.google.com [209.85.208.194]) (using TLSv1.2 with cipher ECDHE-RSA-AES128-GCM-SHA256 (128/128 bits)) (No client certificate requested) by dev.tarantool.org (Postfix) with ESMTPS id A71FD445322 for ; Tue, 14 Jul 2020 17:45:07 +0300 (MSK) Received: by mail-lj1-f194.google.com with SMTP id h22so23057717lji.9 for ; Tue, 14 Jul 2020 07:45:07 -0700 (PDT) From: Cyrill Gorcunov Date: Tue, 14 Jul 2020 17:44:38 +0300 Message-Id: <20200714144440.551127-3-gorcunov@gmail.com> In-Reply-To: <20200714144440.551127-1-gorcunov@gmail.com> References: <20200714144440.551127-1-gorcunov@gmail.com> MIME-Version: 1.0 Content-Transfer-Encoding: 8bit Subject: [Tarantool-patches] [PATCH 2/4] qsync: drop txn_limbo_confirm_timeout List-Id: Tarantool development patches List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , To: Vladislav Shpilevoy Cc: tml We already use replication_synchro_quorum in code, no need for this wrap. Signed-off-by: Cyrill Gorcunov --- src/box/box.cc | 2 +- src/box/txn_limbo.c | 11 ++--------- src/box/txn_limbo.h | 3 --- 3 files changed, 3 insertions(+), 13 deletions(-) diff --git a/src/box/box.cc b/src/box/box.cc index 884061a81..7a7befc32 100644 --- a/src/box/box.cc +++ b/src/box/box.cc @@ -959,7 +959,7 @@ box_clear_synchro_queue(void) return; /* Wait until pending confirmations/rollbacks reach us. */ - double timeout = 2 * txn_limbo_confirm_timeout(&txn_limbo); + double timeout = 2 * replication_synchro_timeout; double start_tm = fiber_time(); while (!txn_limbo_is_empty(&txn_limbo)) { if (fiber_time() - start_tm > timeout) diff --git a/src/box/txn_limbo.c b/src/box/txn_limbo.c index 9623b71cf..15dbe6515 100644 --- a/src/box/txn_limbo.c +++ b/src/box/txn_limbo.c @@ -173,7 +173,7 @@ txn_limbo_wait_complete(struct txn_limbo *limbo, struct txn_limbo_entry *entry) assert(txn_has_flag(txn, TXN_WAIT_SYNC)); double start_time = fiber_clock(); while (true) { - double deadline = start_time + txn_limbo_confirm_timeout(limbo); + double deadline = start_time + replication_synchro_timeout; bool cancellable = fiber_set_cancellable(false); double timeout = deadline - fiber_clock(); bool timed_out = fiber_cond_wait_timeout(&limbo->wait_cond, @@ -450,13 +450,6 @@ txn_limbo_ack(struct txn_limbo *limbo, uint32_t replica_id, int64_t lsn) } } -double -txn_limbo_confirm_timeout(struct txn_limbo *limbo) -{ - (void)limbo; - return replication_synchro_timeout; -} - /** * Waitpoint stores information about the progress of confirmation. * In the case of multimaster support, it will store a bitset @@ -516,7 +509,7 @@ txn_limbo_wait_confirm(struct txn_limbo *limbo) txn_on_rollback(tle->txn, &on_rollback); double start_time = fiber_clock(); while (true) { - double deadline = start_time + txn_limbo_confirm_timeout(limbo); + double deadline = start_time + replication_synchro_timeout; bool cancellable = fiber_set_cancellable(false); double timeout = deadline - fiber_clock(); int rc = fiber_cond_wait_timeout(&limbo->wait_cond, timeout); diff --git a/src/box/txn_limbo.h b/src/box/txn_limbo.h index 918db2263..8cfb490c3 100644 --- a/src/box/txn_limbo.h +++ b/src/box/txn_limbo.h @@ -232,9 +232,6 @@ txn_limbo_read_confirm(struct txn_limbo *limbo, int64_t lsn); void txn_limbo_read_rollback(struct txn_limbo *limbo, int64_t lsn); -double -txn_limbo_confirm_timeout(struct txn_limbo *limbo); - /** * Waiting for confirmation of all "sync" transactions * during confirm timeout or fail. -- 2.26.2