From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from smtp57.i.mail.ru (smtp57.i.mail.ru [217.69.128.37]) (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 F3F0042EF5C for ; Tue, 16 Jun 2020 02:05:49 +0300 (MSK) References: From: Vladislav Shpilevoy Message-ID: <9d1ccba6-744c-2a2c-f06b-aec89440a58c@tarantool.org> Date: Tue, 16 Jun 2020 01:05:47 +0200 MIME-Version: 1.0 In-Reply-To: Content-Type: text/plain; charset=utf-8 Content-Language: en-US Content-Transfer-Encoding: 7bit Subject: Re: [Tarantool-patches] [PATCH] replication: add support of qsync to the snapshot machinery List-Id: Tarantool development patches List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , To: Leonid Vasiliev , gorcunov@gmail.com, sergepetrenko@tarantool.org Cc: tarantool-patches@dev.tarantool.org I appended a new commit on top of this one on the branch: ==================== replication: use replication_synchro_timeout for snaps [TO BE SQUASHED INTO THE PREVIOUS COMMIT] diff --git a/src/box/gc.c b/src/box/gc.c index fb7b37a2e..9b7c510f6 100644 --- a/src/box/gc.c +++ b/src/box/gc.c @@ -68,9 +68,6 @@ gc_cleanup_fiber_f(va_list); static int gc_checkpoint_fiber_f(va_list); -//TODO: quorum timeout should be used instead -double snap_confirm_timeout = 5.0; /* seconds */ - /** * Waitpoint stores information about the progress of confirmation. * In the case of multimaster support, it will store a bitset @@ -422,7 +419,7 @@ gc_txn_rollback_cb(struct trigger *trigger, void *event) /** * Waiting for confirmation of all "sync" transactions - * during snap_confirm_timeout or fail. + * during confirm timeout or fail. */ static int gc_wait_confirm(void) @@ -442,7 +439,7 @@ gc_wait_confirm(void) txn_on_rollback(tle->txn, &on_rollback); int rc = fiber_cond_wait_timeout(&cwp.confirm_cond, - snap_confirm_timeout); + txn_limbo_confirm_timeout(&txn_limbo)); fiber_cond_destroy(&cwp.confirm_cond); if (rc != 0) { /* Clear the triggers if the timeout has been reached. */ diff --git a/src/box/txn_limbo.c b/src/box/txn_limbo.c index 03cbed703..2e3d7a278 100644 --- a/src/box/txn_limbo.c +++ b/src/box/txn_limbo.c @@ -229,6 +229,13 @@ 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; +} + void txn_limbo_init(void) { diff --git a/src/box/txn_limbo.h b/src/box/txn_limbo.h index c0b821a23..23019e5d9 100644 --- a/src/box/txn_limbo.h +++ b/src/box/txn_limbo.h @@ -185,6 +185,9 @@ txn_limbo_last_entry(struct txn_limbo *limbo) in_queue); } +double +txn_limbo_confirm_timeout(struct txn_limbo *limbo); + void txn_limbo_init();