From: Cyrill Gorcunov <gorcunov@gmail.com> To: tml <tarantool-patches@dev.tarantool.org> Subject: [Tarantool-patches] [PATCH] vclock: rename vclock_reset to vclock_set Date: Wed, 15 Apr 2020 17:13:59 +0300 [thread overview] Message-ID: <20200415141359.16253-1-gorcunov@gmail.com> (raw) 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
next reply other threads:[~2020-04-15 14:14 UTC|newest] Thread overview: 4+ messages / expand[flat|nested] mbox.gz Atom feed top 2020-04-15 14:13 Cyrill Gorcunov [this message] 2020-04-15 16:09 ` Konstantin Osipov 2020-04-15 16:21 ` Cyrill Gorcunov 2020-04-15 16:32 ` Konstantin Osipov
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=20200415141359.16253-1-gorcunov@gmail.com \ --to=gorcunov@gmail.com \ --cc=tarantool-patches@dev.tarantool.org \ --subject='Re: [Tarantool-patches] [PATCH] vclock: rename vclock_reset to vclock_set' \ /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