Skip to content

Commit 78220f8

Browse files
Serpentianylobankov
authored andcommitted
Fix wait_for_downstream_to
Currently `wait_for_downstream_to` doesn't wait for replica to be up to date with master. It only checks, that downstream "knows" correct vclock of the replica by taking vclock of remote server and waiting for info.downstream.vclock to be the same. The function's comment says the opposite, so this is not expected behavior. Let's take local vclock instead. This way the function will wait for remote server to apply all master's data. Moreover, let's update function's comment to be less vague. Closes tarantool/tarantool-qa#311
1 parent 5b704ac commit 78220f8

File tree

1 file changed

+3
-2
lines changed

1 file changed

+3
-2
lines changed

luatest/server.lua

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -858,12 +858,13 @@ function Server:wait_for_vclock(vclock)
858858
end
859859
end
860860

861-
--- Wait until all own data is replicated and confirmed by the given server.
861+
--- Wait for the given server to reach at least the same vclock as the local
862+
-- server. Not including the local component, of course.
862863
--
863864
-- @tab server Server's object.
864865
function Server:wait_for_downstream_to(server)
865866
local id = server:get_instance_id()
866-
local vclock = server:get_vclock()
867+
local vclock = self:get_vclock()
867868
vclock[0] = nil -- first component is for local changes
868869
while true do
869870
if vclock_ge(self:get_downstream_vclock(id), vclock) then

0 commit comments

Comments
 (0)