From: Oleg Babin via Tarantool-patches <tarantool-patches@dev.tarantool.org>
To: Vladislav Shpilevoy <v.shpilevoy@tarantool.org>,
tarantool-patches@dev.tarantool.org
Subject: Re: [Tarantool-patches] [PATCH vshard 2/2] router: don't fallback RO to master right away
Date: Tue, 7 Dec 2021 09:49:59 +0300 [thread overview]
Message-ID: <633b9699-f39a-d526-cfa5-03259c1f6c0b@tarantool.org> (raw)
In-Reply-To: <3c1aff55-004d-183a-4b94-be663255a310@tarantool.org>
Thanks for your fixes. LGTM.
On 07.12.2021 02:56, Vladislav Shpilevoy wrote:
> Thanks for the review!
>
> On 05.12.2021 18:53, Oleg Babin wrote:
>> Thanks for your patch. See one comment below.
>>
>> Also as I see CI is red on your branch. Is it related to your changes?
> Yes, I didn't update .result file in one of the tests. Done now.
>
>>> diff --git a/vshard/replicaset.lua b/vshard/replicaset.lua
>>> index 174c761..93f210e 100644
>>> --- a/vshard/replicaset.lua
>>> +++ b/vshard/replicaset.lua
>>> @@ -455,18 +455,25 @@ local function replicaset_template_multicallro(prefer_replica, balance)
>>> return r
>>> end
>>> end
>>> - elseif prefer_replica then
>>> - r = replicaset.replica
>>> + else
>>> + local start_r = replicaset.replica
>>> + r = start_r
>>> while r do
>>> - if r:is_connected() and r ~= master then
>>> + if r:is_connected() and (not prefer_replica or r ~= master) then
>>> return r
>>> end
>>> r = r.next_by_priority
>>> end
>>> - else
>>> - r = replicaset.replica
>>> - if r and r:is_connected() then
>>> - return r
>>> + -- Iteration above could start not from the best prio replica.
>>> + -- Check the beginning of the list too.
>>> + for _, r in pairs(replicaset.priority_list) do
>> pairs can't be jitted (at least now until https://github.com/tarantool/tarantool/issues/6475).
>>
>> Also pairs don't give any guarantees about iteration order. Could it be replaced with ipairs?
> It can be. Replaced with ipairs on the branch.
next prev parent reply other threads:[~2021-12-07 6:50 UTC|newest]
Thread overview: 10+ messages / expand[flat|nested] mbox.gz Atom feed top
2021-12-04 0:19 [Tarantool-patches] [PATCH vshard 0/2] VShard replica backoff, part 1 Vladislav Shpilevoy via Tarantool-patches
2021-12-04 0:19 ` [Tarantool-patches] [PATCH vshard 1/2] router: drop wait_connected from master discovery Vladislav Shpilevoy via Tarantool-patches
2021-12-05 17:44 ` Oleg Babin via Tarantool-patches
2021-12-06 23:34 ` Vladislav Shpilevoy via Tarantool-patches
2021-12-07 6:49 ` Oleg Babin via Tarantool-patches
2021-12-04 0:19 ` [Tarantool-patches] [PATCH vshard 2/2] router: don't fallback RO to master right away Vladislav Shpilevoy via Tarantool-patches
2021-12-05 17:53 ` Oleg Babin via Tarantool-patches
2021-12-06 23:56 ` Vladislav Shpilevoy via Tarantool-patches
2021-12-07 6:49 ` Oleg Babin via Tarantool-patches [this message]
2021-12-07 22:38 ` [Tarantool-patches] [PATCH vshard 0/2] VShard replica backoff, part 1 Vladislav Shpilevoy via Tarantool-patches
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=633b9699-f39a-d526-cfa5-03259c1f6c0b@tarantool.org \
--to=tarantool-patches@dev.tarantool.org \
--cc=olegrok@tarantool.org \
--cc=v.shpilevoy@tarantool.org \
--subject='Re: [Tarantool-patches] [PATCH vshard 2/2] router: don'\''t fallback RO to master right away' \
/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