[tarantool-patches] [PATCH 1/1] replication: use strict order for replication settings

Vladislav Shpilevoy v.shpilevoy at tarantool.org
Sun Sep 29 19:31:30 MSK 2019


The previous patch introduced a way to set box.cfg options
in a strict order, even on a reconfiguration. It was used to set
listen before replication.
The same order problem existed for replication settings. A user
could do

    box.cfg{
        replication_connect_quorum = 0,
        replication = {...}
    }

and expect, that due to quorum 0 the cfg() will return
immediately. But actually the behaviour was undefined - due to
arbitrary order of keys in a Lua table, replication could be
applied before quorum.

The patch makes all replication settings be applied before
replication.

Follow up #4433
Part of #3760
---
 src/box/lua/load_cfg.lua | 7 +++++++
 1 file changed, 7 insertions(+)

diff --git a/src/box/lua/load_cfg.lua b/src/box/lua/load_cfg.lua
index 8ae72767d..fd2106222 100644
--- a/src/box/lua/load_cfg.lua
+++ b/src/box/lua/load_cfg.lua
@@ -271,6 +271,13 @@ local dynamic_cfg = {
 --
 local dynamic_cfg_order = {
     listen                  = 100,
+    -- Order of replication_* options does not matter. The only
+    -- rule - apply before replication itself.
+    replication_timeout     = 150,
+    replication_sync_lag    = 150,
+    replication_sync_timeout    = 150,
+    replication_connect_timeout = 150,
+    replication_connect_quorum  = 150,
     replication             = 200,
 }
 
-- 
2.21.0 (Apple Git-122)





More information about the Tarantool-patches mailing list