From 99517b525c0365bb5363d840d5258e8258902cbf Mon Sep 17 00:00:00 2001
From: Serge Petrenko <sergepetrenko@tarantool.org>
Date: Thu, 21 Feb 2019 20:43:55 +0300
Subject: [PATCH] box: set readahead before replicaset sync

Previously readahead was set after the instance synced with all existing
masters. This could lead to a case when some client connections created
rather early would start with default readahead value even when
it was explicitly set to some value.
So, start setting readahead before replicaset sync.

Follow-up: #3958
---
 src/box/box.cc           | 1 +
 src/box/lua/load_cfg.lua | 1 +
 2 files changed, 2 insertions(+)

diff --git a/src/box/box.cc b/src/box/box.cc
index a3d708fc91..cf2254d0cf 100644
--- a/src/box/box.cc
+++ b/src/box/box.cc
@@ -2122,6 +2122,7 @@ box_cfg_xc(void)
 	box_check_replicaset_uuid(&replicaset_uuid);
 
 	box_set_net_msg_max();
+	box_set_readahead();
 	box_set_too_long_threshold();
 	box_set_replication_timeout();
 	box_set_replication_connect_timeout();
diff --git a/src/box/lua/load_cfg.lua b/src/box/lua/load_cfg.lua
index fc4e560d9c..6c9a820426 100644
--- a/src/box/lua/load_cfg.lua
+++ b/src/box/lua/load_cfg.lua
@@ -274,6 +274,7 @@ local dynamic_cfg_skip_at_load = {
     instance_uuid           = true,
     replicaset_uuid         = true,
     net_msg_max             = true,
+    readahead               = true,
 }
 
 local function convert_gb(size)
-- 
GitLab