From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from smtpng2.m.smailru.net (smtpng2.m.smailru.net [94.100.179.3]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by dev.tarantool.org (Postfix) with ESMTPS id 1612C430407 for ; Sat, 15 Aug 2020 18:16:45 +0300 (MSK) From: Vladislav Shpilevoy Date: Sat, 15 Aug 2020 17:16:44 +0200 Message-Id: <7e16e45e171cb34edaff69b0f660421f1b67b4a1.1597504571.git.v.shpilevoy@tarantool.org> MIME-Version: 1.0 Content-Transfer-Encoding: 8bit Subject: [Tarantool-patches] [PATCH 1/1] applier: drop a couple of unnecessary arguments List-Id: Tarantool development patches List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , To: tarantool-patches@dev.tarantool.org, gorcunov@gmail.com 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)