Tarantool development patches archive
 help / color / mirror / Atom feed
* [Tarantool-patches] [PATCH] vclock: rename vclock_reset to vclock_set
@ 2020-04-15 14:13 Cyrill Gorcunov
  2020-04-15 16:09 ` Konstantin Osipov
  0 siblings, 1 reply; 4+ messages in thread
From: Cyrill Gorcunov @ 2020-04-15 14:13 UTC (permalink / raw)
  To: tml

The `reset` keyword is too overloaded, its traditional
context is to setup some value either to zero or to default.

That is not what we're doing in this helper: we rather set up
a new value to the replica_id in the map, keeping consistency
of the sum.

Thus lets name it as it should -- vclock_set.

Signed-off-by: Cyrill Gorcunov <gorcunov@gmail.com>
---
 src/box/box.cc   | 2 +-
 src/box/vclock.h | 4 ++--
 2 files changed, 3 insertions(+), 3 deletions(-)

diff --git a/src/box/box.cc b/src/box/box.cc
index af92b55a8..c4f83c575 100644
--- a/src/box/box.cc
+++ b/src/box/box.cc
@@ -1905,7 +1905,7 @@ box_process_subscribe(struct ev_io *io, struct xrow_header *header)
 	 * Speaking of gc, remote instances' local vclock
 	 * components are not used by consumers at all.
 	 */
-	vclock_reset(&replica_clock, 0, vclock_get(&replicaset.vclock, 0));
+	vclock_set(&replica_clock, 0, vclock_get(&replicaset.vclock, 0));
 	/*
 	 * Process SUBSCRIBE request via replication relay
 	 * Send current recovery vector clock as a marker
diff --git a/src/box/vclock.h b/src/box/vclock.h
index 5865f7443..8d62b561f 100644
--- a/src/box/vclock.h
+++ b/src/box/vclock.h
@@ -193,7 +193,7 @@ vclock_inc(struct vclock *vclock, uint32_t replica_id)
  * @param lsn Lsn to set
  */
 static inline void
-vclock_reset(struct vclock *vclock, uint32_t replica_id, int64_t lsn)
+vclock_set(struct vclock *vclock, uint32_t replica_id, int64_t lsn)
 {
 	assert(lsn >= 0);
 	assert(replica_id < VCLOCK_MAX);
@@ -411,7 +411,7 @@ vclock_min_ignore0(struct vclock *a, const struct vclock *b)
 		int64_t lsn_b = vclock_get(b, replica_id);
 		if (lsn_a <= lsn_b)
 			continue;
-		vclock_reset(a, replica_id, lsn_b);
+		vclock_set(a, replica_id, lsn_b);
 	}
 }
 
-- 
2.20.1

^ permalink raw reply	[flat|nested] 4+ messages in thread

end of thread, other threads:[~2020-04-15 16:32 UTC | newest]

Thread overview: 4+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2020-04-15 14:13 [Tarantool-patches] [PATCH] vclock: rename vclock_reset to vclock_set Cyrill Gorcunov
2020-04-15 16:09 ` Konstantin Osipov
2020-04-15 16:21   ` Cyrill Gorcunov
2020-04-15 16:32     ` Konstantin Osipov

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