[Tarantool-patches] [PATCH 3/8] txn: add TXN_WAIT_ACK flag

Vladislav Shpilevoy v.shpilevoy at tarantool.org
Wed Jun 24 01:13:35 MSK 2020


>>>>        stailq_foreach_entry(stmt, &txn->stmts, next) {
>>>>            if (stmt->has_triggers) {
>>>>                txn_init_triggers(txn);
>>>>                rlist_splice(&txn->on_commit, &stmt->on_commit);
>>>>            }
>>>> +        is_sync = is_sync || stmt->space->def->opts.is_sync;
>>> Seems like
>>> "... || (stmt->space != NULL && stmt->space->def->opts.is_sync);"
>>> can be moved here from "replication: make sync transactions wait quorum".
>>>
>>> LGTM.
>> I don't think it is a good idea. At this commit stmt->space can't be
>> NULL. This becomes possible only after Sergey P. starts using txns
>> to write confirm and rollback entries, which don't relate to any
>> space.
> 
> Actually, stmt->space is NULL for NOPs.

Force pushed to this commit:

diff --git a/src/box/txn.c b/src/box/txn.c
index 22591a365..edc1f5180 100644
--- a/src/box/txn.c
+++ b/src/box/txn.c
@@ -507,7 +507,8 @@ txn_journal_entry_new(struct txn *txn)
 		if (stmt->row == NULL)
 			continue;
 
-		is_sync = is_sync || stmt->space->def->opts.is_sync;
+		is_sync = is_sync || (stmt->space != NULL &&
+				      stmt->space->def->opts.is_sync);
 
 		if (stmt->row->replica_id == 0)
 			*local_row++ = stmt->row;


More information about the Tarantool-patches mailing list