[Tarantool-patches] [PATCH 3/3] box: remove is_local_recovery variable
Vladislav Shpilevoy
v.shpilevoy at tarantool.org
Fri Apr 2 01:23:44 MSK 2021
It was used so as to recover synchronous auto-commit transactions
in an async way (not blocking the fiber). But it became not
necessary since #5874 was fixed. Because recovery does not use
auto-commit transactions anymore.
Closes #5194
---
src/box/box.cc | 12 +-----------
1 file changed, 1 insertion(+), 11 deletions(-)
diff --git a/src/box/box.cc b/src/box/box.cc
index f70a2bd0e..8eacbfebb 100644
--- a/src/box/box.cc
+++ b/src/box/box.cc
@@ -125,8 +125,6 @@ static struct gc_checkpoint_ref backup_gc;
static bool is_box_configured = false;
static bool is_ro = true;
static fiber_cond ro_cond;
-/** Set to true during recovery from local files. */
-static bool is_local_recovery = false;
/**
* The following flag is set if the instance failed to
@@ -241,7 +239,6 @@ box_process_rw(struct request *request, struct space *space,
goto rollback;
if (is_autocommit) {
- int res = 0;
/*
* During local recovery the commit procedure
* should be async, otherwise the only fiber
@@ -253,12 +250,7 @@ box_process_rw(struct request *request, struct space *space,
* all during local recovery, since journal_write
* is faked at this stage and returns immediately.
*/
- if (is_local_recovery) {
- res = txn_commit_try_async(txn);
- } else {
- res = txn_commit(txn);
- }
- if (res < 0)
+ if (txn_commit(txn) < 0)
goto error;
fiber_gc();
}
@@ -3037,7 +3029,6 @@ local_recovery(const struct tt_uuid *instance_uuid,
memtx = (struct memtx_engine *)engine_by_name("memtx");
assert(memtx != NULL);
- is_local_recovery = true;
recovery_journal_create(&recovery->vclock);
/*
@@ -3096,7 +3087,6 @@ local_recovery(const struct tt_uuid *instance_uuid,
}
stream_guard.is_active = false;
recovery_finalize(recovery);
- is_local_recovery = false;
/*
* We must enable WAL before finalizing engine recovery,
--
2.24.3 (Apple Git-128)
More information about the Tarantool-patches
mailing list