From: Serge Petrenko <sergepetrenko@tarantool.org> To: Vladislav Shpilevoy <v.shpilevoy@tarantool.org> Cc: tarantool-patches@dev.tarantool.org Subject: Re: [Tarantool-patches] [PATCH v5 2/4] replication: hide 0-th vclock components in replication responses Date: Tue, 7 Apr 2020 15:22:49 +0300 [thread overview] Message-ID: <D083EA67-2287-473F-8185-07C09EB48AA7@tarantool.org> (raw) In-Reply-To: <719eb559-bb1e-389d-79f4-02c48bfa5d19@tarantool.org> Hi! Thanks for the review! > 4 апр. 2020 г., в 23:51, Vladislav Shpilevoy <v.shpilevoy@tarantool.org> написал(а): > > Thanks for the patch! > > Was it considered to ignore 0 component on receiver's > side rather than on sender's? > > I see this: > >> This is needed for backward compatibility with old instances, which >> don't ignore 0th vclock component coming from a remote instance by >> default. > > But can anon replicas connect to old versions? Anon replicas can be promoted to normal ones, and then connect to old versions, while still having a non-zero vclock[0]. > > I am not saying that it would be better, but I don't > see why technically not. > > On 30/03/2020 13:04, Serge Petrenko wrote: >> If an anonymous replica is promoted to a normal one and becomes >> replication master later, its vclock contains a non-empty zero >> component, tracking local changes on this replica from the time when it >> had been anonymous. No need to pollute joining instance's vclock with >> our non-empty 0 component. >> When an anonymous replica reports its status to a remote instance it >> should also hide its 0-th vclock component. >> >> This is needed for backward compatibility with old instances, which >> don't ignore 0th vclock component coming from a remote instance by >> default. >> Also make sure that new instances ignore 0th vclock component. >> >> Follow-up #3186 >> Prerequisite #4114 >> --- >> src/box/applier.cc | 4 +++- >> src/box/box.cc | 12 ++++++++---- >> src/box/relay.cc | 6 ++++-- >> test/replication/anon.result | 5 +++++ >> test/replication/anon.test.lua | 2 ++ >> 5 files changed, 22 insertions(+), 7 deletions(-) >> >> diff --git a/src/box/applier.cc b/src/box/applier.cc >> index 47a26c366..f5f67b6a9 100644 >> --- a/src/box/applier.cc >> +++ b/src/box/applier.cc >> @@ -173,7 +173,9 @@ applier_writer_f(va_list ap) >> continue; >> try { >> struct xrow_header xrow; >> - xrow_encode_vclock(&xrow, &replicaset.vclock); >> + struct vclock vclock; >> + vclock_copy_ignore0(&vclock, &replicaset.vclock); >> + xrow_encode_vclock(&xrow, &vclock); > > xrow_encode_vclock without 0 component is needed 4 times. > With 0 it is encoded 2 times. Maybe better add a function > xrow_encode_vclock_ignore0 or like that. Because copy_ignore0 > is copying of ~290 bytes. This is several cache lines. Okay, will do. > > Probably even the original xrow_encode_vclock can appear to be > not needed anywhere. -- Serge Petrenko sergepetrenko@tarantool.org
next prev parent reply other threads:[~2020-04-07 12:22 UTC|newest] Thread overview: 22+ messages / expand[flat|nested] mbox.gz Atom feed top 2020-03-30 11:04 [Tarantool-patches] [PATCH v5 0/4] replication: fix local space tracking Serge Petrenko 2020-03-30 11:04 ` [Tarantool-patches] [PATCH v5 1/4] vclock: add an ability to reset individual clock components Serge Petrenko 2020-03-30 12:56 ` Konstantin Osipov 2020-04-04 20:51 ` Vladislav Shpilevoy 2020-04-06 8:39 ` Konstantin Osipov 2020-04-07 11:48 ` Serge Petrenko 2020-03-30 11:04 ` [Tarantool-patches] [PATCH v5 2/4] replication: hide 0-th vclock components in replication responses Serge Petrenko 2020-03-30 12:56 ` Konstantin Osipov 2020-04-04 20:51 ` Vladislav Shpilevoy 2020-04-06 8:38 ` Konstantin Osipov 2020-04-07 12:22 ` Serge Petrenko [this message] 2020-03-30 11:04 ` [Tarantool-patches] [PATCH v5 3/4] gc: rely on minimal vclock components instead of signatures Serge Petrenko 2020-03-30 12:57 ` Konstantin Osipov 2020-04-04 20:51 ` Vladislav Shpilevoy 2020-04-07 12:40 ` Serge Petrenko 2020-03-30 11:04 ` [Tarantool-patches] [PATCH v5 4/4] box: start counting local space requests separately Serge Petrenko 2020-03-30 12:58 ` Konstantin Osipov 2020-04-04 20:51 ` Vladislav Shpilevoy 2020-04-07 15:48 ` Serge Petrenko 2020-03-31 11:24 ` [Tarantool-patches] [PATCH v5 0/4] replication: fix local space tracking Serge Petrenko 2020-04-04 20:51 ` Vladislav Shpilevoy 2020-04-07 11:15 ` Serge Petrenko
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=D083EA67-2287-473F-8185-07C09EB48AA7@tarantool.org \ --to=sergepetrenko@tarantool.org \ --cc=tarantool-patches@dev.tarantool.org \ --cc=v.shpilevoy@tarantool.org \ --subject='Re: [Tarantool-patches] [PATCH v5 2/4] replication: hide 0-th vclock components in replication responses' \ /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