Tarantool development patches archive
 help / color / mirror / Atom feed
From: Vladislav Shpilevoy <v.shpilevoy@tarantool.org>
To: tarantool-patches@dev.tarantool.org, gorcunov@gmail.com
Subject: [Tarantool-patches] [PATCH 1/1] applier: drop a couple of unnecessary arguments
Date: Sat, 15 Aug 2020 17:16:44 +0200	[thread overview]
Message-ID: <7e16e45e171cb34edaff69b0f660421f1b67b4a1.1597504571.git.v.shpilevoy@tarantool.org> (raw)

Applier on_rollback and on_wal_write don't need any arguments -
they either work with a global state, or with the signaled applier
stored inside the trigger.

However into on_wal_write() and on_rollback() was passed the
transaction object, unused.

Even if it would be used, it should have been fixed, because soon
these triggers will be fired not only for traditional 'txn'
transactions. They will be used by the synchro request WAL writes
too - they don't have 'transactions'.

Part of #5129
---
Branch: http://github.com/tarantool/tarantool/tree/gerold103/applier_triggers_args
Issue: https://github.com/tarantool/tarantool/issues/5129

 src/box/applier.cc | 9 +++++----
 1 file changed, 5 insertions(+), 4 deletions(-)

diff --git a/src/box/applier.cc b/src/box/applier.cc
index a953d293e..34cb0e4b9 100644
--- a/src/box/applier.cc
+++ b/src/box/applier.cc
@@ -802,8 +802,8 @@ applier_txn_rollback_cb(struct trigger *trigger, void *event)
 	diag_set_error(&replicaset.applier.diag,
 		       diag_last_error(diag_get()));
 
-	/* Broadcast the rollback event across all appliers. */
-	trigger_run(&replicaset.applier.on_rollback, event);
+	/* Broadcast the rollback across all appliers. */
+	trigger_run(&replicaset.applier.on_rollback, NULL);
 
 	/* Rollback applier vclock to the committed one. */
 	vclock_copy(&replicaset.applier.vclock, &replicaset.vclock);
@@ -814,8 +814,9 @@ static int
 applier_txn_wal_write_cb(struct trigger *trigger, void *event)
 {
 	(void) trigger;
-	/* Broadcast the commit event across all appliers. */
-	trigger_run(&replicaset.applier.on_wal_write, event);
+	(void) event;
+	/* Broadcast the WAL write across all appliers. */
+	trigger_run(&replicaset.applier.on_wal_write, NULL);
 	return 0;
 }
 
-- 
2.21.1 (Apple Git-122.3)

             reply	other threads:[~2020-08-15 15:16 UTC|newest]

Thread overview: 3+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2020-08-15 15:16 Vladislav Shpilevoy [this message]
2020-08-17  8:02 ` Cyrill Gorcunov
2020-08-17 20:22 ` Vladislav Shpilevoy

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=7e16e45e171cb34edaff69b0f660421f1b67b4a1.1597504571.git.v.shpilevoy@tarantool.org \
    --to=v.shpilevoy@tarantool.org \
    --cc=gorcunov@gmail.com \
    --cc=tarantool-patches@dev.tarantool.org \
    --subject='Re: [Tarantool-patches] [PATCH 1/1] applier: drop a couple of unnecessary arguments' \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox