diff options
author | Oran Agra <oran@redislabs.com> | 2022-01-17 14:11:11 +0200 |
---|---|---|
committer | GitHub <noreply@github.com> | 2022-01-17 14:11:11 +0200 |
commit | ae89958972ee720be2bff68231d6353553c2272a (patch) | |
tree | d0cc61d5bc718b7c5077e5746abb802184423851 /redis.conf | |
parent | 90916f16a5536bc833529d2e563d1094433de495 (diff) | |
download | redis-ae89958972ee720be2bff68231d6353553c2272a.tar.gz |
Set repl-diskless-sync to yes by default, add repl-diskless-sync-max-replicas (#10092)
1. enable diskless replication by default
2. add a new config named repl-diskless-sync-max-replicas that enables
replication to start before the full repl-diskless-sync-delay was
reached.
3. put replica online sooner on the master (see below)
4. test suite uses repl-diskless-sync-delay of 0 to be faster
5. a few tests that use multiple replica on a pre-populated master, are
now using the new repl-diskless-sync-max-replicas
6. fix possible timing issues in a few cluster tests (see below)
put replica online sooner on the master
----------------------------------------------------
there were two tests that failed because they needed for the master to
realize that the replica is online, but the test code was actually only
waiting for the replica to realize it's online, and in diskless it could
have been before the master realized it.
changes include two things:
1. the tests wait on the right thing
2. issues in the master, putting the replica online in two steps.
the master used to put the replica as online in 2 steps. the first
step was to mark it as online, and the second step was to enable the
write event (only after getting ACK), but in fact the first step didn't
contains some of the tasks to put it online (like updating good slave
count, and sending the module event). this meant that if a test was
waiting to see that the replica is online form the point of view of the
master, and then confirm that the module got an event, or that the
master has enough good replicas, it could fail due to timing issues.
so now the full effect of putting the replica online, happens at once,
and only the part about enabling the writes is delayed till the ACK.
fix cluster tests
--------------------
I added some code to wait for the replica to sync and avoid race
conditions.
later realized the sentinel and cluster tests where using the original 5
seconds delay, so changed it to 0.
this means the other changes are probably not needed, but i suppose
they're still better (avoid race conditions)
Diffstat (limited to 'redis.conf')
-rw-r--r-- | redis.conf | 8 |
1 files changed, 7 insertions, 1 deletions
diff --git a/redis.conf b/redis.conf index 0753f3166..ca3d4d6ad 100644 --- a/redis.conf +++ b/redis.conf @@ -591,7 +591,7 @@ replica-read-only yes # # With slow disks and fast (large bandwidth) networks, diskless replication # works better. -repl-diskless-sync no +repl-diskless-sync yes # When diskless replication is enabled, it is possible to configure the delay # the server waits in order to spawn the child that transfers the RDB via socket @@ -605,6 +605,12 @@ repl-diskless-sync no # it entirely just set it to 0 seconds and the transfer will start ASAP. repl-diskless-sync-delay 5 +# When diskless replication is enabled with a delay, it is possible to let +# the replication start before the maximum delay is reached if the maximum +# number of replicas expected have connected. Default of 0 means that the +# maximum is not defined and Redis will wait the full delay. +repl-diskless-sync-max-replicas 0 + # ----------------------------------------------------------------------------- # WARNING: RDB diskless load is experimental. Since in this setup the replica # does not immediately store an RDB on disk, it may cause data loss during |