[Tarantool-patches] [PATCH vshard 7/7] router: introduce discovery mode 'once'

Oleg Babin olegrok at tarantool.org
Mon May 4 17:27:43 MSK 2020


Got it. Thanks for your answer. LGTM.

On 02/05/2020 23:12, Vladislav Shpilevoy wrote:
> Thanks for the review!
> 
>>> @@ -342,6 +342,13 @@ discovery_f = function(router)
>>>                unknown_bucket_count =
>>>                    router.total_bucket_count - router.known_bucket_count
>>>                if unknown_bucket_count == 0 then
>>> +                if router.discovery_mode == 'once' then
>>> +                    log.info("Discovery mode is 'once', and all is "..
>>> +                             "discovered - shut down the discovery process")
>>> +                    router.discovery_fiber = nil
>>> +                    lfiber.self():cancel()
>>> +                    return
>>> +                end
>>
>> I'm not sure that self.cancel is a good approach. I think simple "return" should be enough.
> 
> The discovery fiber is restarted if it returns or throws. The only
> way to stop it is to cancel. See reloadable_fiber_main_loop() in
> vshard/vshard/util.lua.
> 


More information about the Tarantool-patches mailing list