[Tarantool-patches] [PATCH vshard 7/7] router: introduce discovery mode 'once'
Vladislav Shpilevoy
v.shpilevoy at tarantool.org
Sat May 2 23:12:10 MSK 2020
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