Skip to content

Commit 22a0fcc

Browse files
committed
TNTP-2109: Check that tarantool supports box.watch
1 parent eefef58 commit 22a0fcc

File tree

1 file changed

+8
-0
lines changed

1 file changed

+8
-0
lines changed

crud/common/rebalance.lua

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,5 @@
11
local fiber = require('fiber')
2+
local log = require('log')
23
local vshard_consts = require('vshard.consts')
34
local utils = require('crud.common.utils')
45

@@ -84,6 +85,13 @@ local function safe_mode_disable()
8485
end
8586

8687
local function rebalance_init()
88+
-- box.watch was introduced in tarantool 2.10.0
89+
if box.watch == nil then
90+
log.warn('This version of tarantool does not support autoswitch to safe mode during rebalance. '
91+
.. 'Update to newer version or use `_crud.rebalance_safe_mode_enable()` to enable safe mode manually.')
92+
return
93+
end
94+
8795
box.watch('box.status', function()
8896
if box.info.ro then
8997
return

0 commit comments

Comments
 (0)