[Tarantool-patches] [PATCH] replication: add support of qsync to the snapshot machinery
Vladislav Shpilevoy
v.shpilevoy at tarantool.org
Tue Jun 16 02:05:47 MSK 2020
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();
More information about the Tarantool-patches
mailing list