rename slave to replica in the redis omnibus configuration
In redis 5 the default config updated terminology to use replica
over slave
, this means our redis omnibus config is a bit out of date.
Note: replica
is an alias for slave
and I don't see any discussion about deprecating the old term, so there is no urgency here to change it other than config rewrites on reconfigure.
Much like how sentinel re-writes its own configuration frequently redis will do this on every CONFIG REWRITE
. When this happens every instance of slave
will be rewritten to replica
and will result in a restart after a gitlab-ctl reconfigure
.
CONFIG REWRITE example:
==> /var/log/gitlab/redis/current <==
2020-03-05_16:04:53.33277 31394:M 05 Mar 2020 16:04:53.332 * DB loaded from disk: 16.853 seconds
2020-03-05_16:04:53.33285 31394:M 05 Mar 2020 16:04:53.332 * Ready to accept connections
2020-03-05_16:04:57.50776 31394:S 05 Mar 2020 16:04:57.507 * Before turning into a replica, using my master parameters to synthesize a cached master: I may be able to synchronize with the new master with just a partial transfer.
2020-03-05_16:04:57.50784 31394:S 05 Mar 2020 16:04:57.507 * REPLICAOF 10.224.7.103:6379 enabled (user request from 'id=6 addr=10.224.7.103:38355 fd=10 name= age=20 idle=0 flags=x db=0 sub=0 psub=0 multi=3 qbuf=152 qbuf-free=32616 obl=36 oll=0 omem=0 events=r cmd=exec')
2020-03-05_16:04:57.50898 31394:S 05 Mar 2020 16:04:57.508 # CONFIG REWRITE executed with success.
2020-03-05_16:04:58.34763 31394:S 05 Mar 2020 16:04:58.347 * Connecting to MASTER 10.224.7.103:6379
2020-03-05_16:04:58.34856 31394:S 05 Mar 2020 16:04:58.347 * MASTER <-> REPLICA sync started
2020-03-05_16:04:58.34916 31394:S 05 Mar 2020 16:04:58.347 * Non blocking connect for SYNC fired the event.
2020-03-05_16:04:58.34917 31394:S 05 Mar 2020 16:04:58.348 * Master replied to PING, replication can continue...
2020-03-05_16:04:58.34919 31394:S 05 Mar 2020 16:04:58.349 * Trying a partial resynchronization (request ff94ef9bfd94afdc51ff379edc29b23c09c1ccdb:1).
2020-03-05_16:04:58.48921 31394:S 05 Mar 2020 16:04:58.489 * Full resync from master: 3d62400c3051bfa07015410a209903754eae5553:1454764545045
2020-03-05_16:04:58.48930 31394:S 05 Mar 2020 16:04:58.489 * Discarding previously cached master state.
2020-03-05_16:05:25.05419 31394:S 05 Mar 2020 16:05:25.054 * MASTER <-> REPLICA sync: receiving 1353871297 bytes from master
2020-03-05_16:05:35.59064 31394:S 05 Mar 2020 16:05:35.590 * MASTER <-> REPLICA sync: Flushing old data
2020-03-05_16:05:46.27276 31394:S 05 Mar 2020 16:05:46.272 * MASTER <-> REPLICA sync: Loading DB in memory
2020-03-05_16:06:03.37076 31394:S 05 Mar 2020 16:06:03.370 * MASTER <-> REPLICA sync: Finished with success
I'm not sure there is anything we can do to avoid restarts (we avoid issuing reconfigures completely on our omnibus redis VMs because of this), but it would be good to update our default config since these config changes might catch someone by surprise.
for example, after the rewrite reconfigure tries setting all the replica
strings back to slave
.
-replica-serve-stale-data yes
+slave-serve-stale-data yes