[tarantool-patches] Re: [PATCH 3/3] Transaction support for applier
Konstantin Osipov
kostja at tarantool.org
Tue Mar 5 12:28:09 MSK 2019
* Georgy Kirichenko <georgy at tarantool.org> [19/03/03 23:30]:
> @@ -271,14 +276,20 @@ txn_write_to_wal(struct txn *txn)
> return -1;
>
> struct txn_stmt *stmt;
> - struct xrow_header **row = req->rows;
> + struct xrow_header **remote_row = req->rows;
> + struct xrow_header **local_row = req->rows + txn->n_remote_rows;
> stailq_foreach_entry(stmt, &txn->stmts, next) {
> if (stmt->row == NULL)
> continue; /* A read (e.g. select) request */
> - *row++ = stmt->row;
> + if (stmt->row->replica_id != 0 &&
> + stmt->row->replica_id != instance_id)
> + *remote_row++ = stmt->row;
> + else
> + *local_row++ = stmt->row;
> req->approx_len += xrow_approx_len(stmt->row);
> }
> - assert(row == req->rows + req->n_rows);
> + assert(remote_row == req->rows + txn->n_remote_rows);
> + assert(local_row == req->rows + req->n_rows);
AFAIU this patch tests local rows by means of
replication_skip_conflict option. Could you please also test it
with local on_replace/before_replace triggers? Besides, now that
applier issues multi-statement transactions, we could add a test
for on_commit/on_rollback triggers fired from applier as well. We
could set such triggers from statement-level triggers.
--
Konstantin Osipov, Moscow, Russia, +7 903 626 22 32
http://tarantool.io - www.twitter.com/kostja_osipov
More information about the Tarantool-patches
mailing list