[Tarantool-patches] [PATCH vshard 6/6] router: update master using a hint from storage

Vladislav Shpilevoy v.shpilevoy at tarantool.org
Mon Jul 5 23:53:59 MSK 2021


>   - After changes in previous patch I think it could be better to use "master_search_wakeup" instead of master_search_fiber:wakeup()

Yes, I forgot to update this commit. Done now:

====================
diff --git a/test/router/master_discovery.result b/test/router/master_discovery.result
index 8416c8f..7ebb67d 100644
--- a/test/router/master_discovery.result
+++ b/test/router/master_discovery.result
@@ -115,7 +115,7 @@ function check_no_master_for_replicaset(rs_id)
     if not master then                                                          \
         return true                                                             \
     end                                                                         \
-    vshard.router.static.master_search_fiber:wakeup()                           \
+    vshard.router.master_search_wakeup()                                        \
     return false                                                                \
 end
  | ---
@@ -170,7 +170,7 @@ function check_master_discovery_block()
     if vshard.router.internal.errinj.ERRINJ_MASTER_SEARCH_DELAY == 'in' then    \
         return true                                                             \
     end                                                                         \
-    vshard.router.static.master_search_fiber:wakeup()                           \
+    vshard.router.master_search_wakeup()                                        \
     return false                                                                \
 end
  | ---
diff --git a/test/router/master_discovery.test.lua b/test/router/master_discovery.test.lua
index 9a9e60d..6276dc9 100644
--- a/test/router/master_discovery.test.lua
+++ b/test/router/master_discovery.test.lua
@@ -73,7 +73,7 @@ function check_no_master_for_replicaset(rs_id)
     if not master then                                                          \
         return true                                                             \
     end                                                                         \
-    vshard.router.static.master_search_fiber:wakeup()                           \
+    vshard.router.master_search_wakeup()                                        \
     return false                                                                \
 end
 
@@ -114,7 +114,7 @@ function check_master_discovery_block()
     if vshard.router.internal.errinj.ERRINJ_MASTER_SEARCH_DELAY == 'in' then    \
         return true                                                             \
     end                                                                         \
-    vshard.router.static.master_search_fiber:wakeup()                           \
+    vshard.router.master_search_wakeup()                                        \
     return false                                                                \
 end
 
====================

>   - Should we document somehow `update_master` method for replicaset object? Or maybe it even shouldn't be a part of public API?

Nope. It is a private method. If something is not documented on the
site, it is private. I couldn't come up with a better scheme and yet
not harm vshard's own code readability.


More information about the Tarantool-patches mailing list