Skip to content

Commit

Permalink
Wait for asyn_loading to stop in short read test (redis#9841)
Browse files Browse the repository at this point in the history
In redis#9323, when `repl-diskless-load` is enabled and set to `swapdb`,
if the master replication ID hasn't changed, we can load data-set
asynchronously, and serving read commands during the full resync.

In `diskless loading short read` test, after a loading successfully,
we will wait for the loading to stop and continue the for loop.

After the introduction of `async_loading`, we also need to check it.
Otherwise the next loop will start too soon, may trigger a timing issue.
  • Loading branch information
enjoy-binbin authored and hwware committed Dec 20, 2021
1 parent ac55248 commit ef9e84f
Show file tree
Hide file tree
Showing 2 changed files with 6 additions and 0 deletions.
3 changes: 3 additions & 0 deletions tests/integration/replication.tcl
Original file line number Diff line number Diff line change
Expand Up @@ -688,8 +688,11 @@ test {diskless loading short read} {
}
$master exec
}

# wait for loading to stop (fail)
# After a loading successfully, next loop will enter `async_loading`
wait_for_condition 1000 1 {
[s -1 async_loading] eq 0 &&
[s -1 loading] eq 0
} else {
fail "Replica didn't disconnect"
Expand Down
3 changes: 3 additions & 0 deletions tests/unit/moduleapi/testrdb.tcl
Original file line number Diff line number Diff line change
Expand Up @@ -114,8 +114,11 @@ tags "modules" {
}
$master exec
}

# wait for loading to stop (fail)
# After a loading successfully, next loop will enter `async_loading`
wait_for_condition 1000 1 {
[s -1 async_loading] eq 0 &&
[s -1 loading] eq 0
} else {
fail "Replica didn't disconnect"
Expand Down

0 comments on commit ef9e84f

Please sign in to comment.