* [Tarantool-patches] [PATCH 1/1] applier: drop a couple of unnecessary arguments
@ 2020-08-15 15:16 Vladislav Shpilevoy
2020-08-17 8:02 ` Cyrill Gorcunov
2020-08-17 20:22 ` Vladislav Shpilevoy
0 siblings, 2 replies; 3+ messages in thread
From: Vladislav Shpilevoy @ 2020-08-15 15:16 UTC (permalink / raw)
To: tarantool-patches, gorcunov
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)
^ permalink raw reply [flat|nested] 3+ messages in thread
* Re: [Tarantool-patches] [PATCH 1/1] applier: drop a couple of unnecessary arguments
2020-08-15 15:16 [Tarantool-patches] [PATCH 1/1] applier: drop a couple of unnecessary arguments Vladislav Shpilevoy
@ 2020-08-17 8:02 ` Cyrill Gorcunov
2020-08-17 20:22 ` Vladislav Shpilevoy
1 sibling, 0 replies; 3+ messages in thread
From: Cyrill Gorcunov @ 2020-08-17 8:02 UTC (permalink / raw)
To: Vladislav Shpilevoy; +Cc: tarantool-patches
On Sat, Aug 15, 2020 at 05:16:44PM +0200, Vladislav Shpilevoy wrote:
> 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
> ---
Acked-by: Cyrill Gorcunov <gorcunov@gmail.com>
^ permalink raw reply [flat|nested] 3+ messages in thread
* Re: [Tarantool-patches] [PATCH 1/1] applier: drop a couple of unnecessary arguments
2020-08-15 15:16 [Tarantool-patches] [PATCH 1/1] applier: drop a couple of unnecessary arguments Vladislav Shpilevoy
2020-08-17 8:02 ` Cyrill Gorcunov
@ 2020-08-17 20:22 ` Vladislav Shpilevoy
1 sibling, 0 replies; 3+ messages in thread
From: Vladislav Shpilevoy @ 2020-08-17 20:22 UTC (permalink / raw)
To: tarantool-patches, gorcunov
Pushed to master and 2.5.
^ permalink raw reply [flat|nested] 3+ messages in thread
end of thread, other threads:[~2020-08-17 20:22 UTC | newest]
Thread overview: 3+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2020-08-15 15:16 [Tarantool-patches] [PATCH 1/1] applier: drop a couple of unnecessary arguments Vladislav Shpilevoy
2020-08-17 8:02 ` Cyrill Gorcunov
2020-08-17 20:22 ` Vladislav Shpilevoy
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox