From e9614f9c4d78abe7a9659058f2ffc8c8e7627557 Mon Sep 17 00:00:00 2001 From: Boris Stepanenko Date: Tue, 17 Jan 2023 10:48:59 +0300 Subject: [PATCH] test_run.lua: add ignore_zero option to get_vclock Sometimes we don't care about zero component of the vclock, for example we want to ignore it when waiting for replica sync, using vclock (don't care about local spaces). --- test_run.lua | 9 +++++++-- 1 file changed, 7 insertions(+), 2 deletions(-) diff --git a/test_run.lua b/test_run.lua index 6347d38c..28ccb261 100644 --- a/test_run.lua +++ b/test_run.lua @@ -79,8 +79,13 @@ local function wait_lsn(self, waiter, master) end end -local function get_vclock(self, node) - return self:get_param(node, 'vclock')[1] +local function get_vclock(self, node, opts) + local opts = opts or {} + local vclock = self:get_param(node, 'vclock')[1] + if opts.ignore_zero then + vclock[0] = nil + end + return vclock end local function wait_vclock(self, node, to_vclock)