Describe the bug
Run SENTINEL failover <master name> in result it chose replica with lower offset.
To reproduce
It is 3 VM with redis 7.2.4 and sentinel installed on same machines. Data set ~ 12GB , around 1.2K op/s. With test environment I was not able to reproduce it
Expected behavior
Sentinel chooses right replica with max replication offset, I had min-replicas-to-write 1 which caused NOREPLICAS error to client and downtime was ~3 min, while rdb storing on disk and finally replicated.
Additional information
10205:M 22 Aug 2024 09:36:44.152 * Discarding previously cached master state.
10205:M 22 Aug 2024 09:36:44.152 * Setting secondary replication ID to a66d28d8971887157f2a3b3148141a95b76f2e6f, valid up to offset: 16323075171101. New replication ID is eeb68e8b58938234bdb026a5f90e4d993ae481f7
10205:M 22 Aug 2024 09:36:44.152 * MASTER MODE enabled (user request from 'id=821 addr=10.2.0.2:46832 laddr=10.2.0.3:6380 fd=13 name=sentinel-64a54934-cmd age=798 idle=0 flags=x db=0 sub=0 psub=0 ssub=0 multi=4 qbuf=188 qbuf-free=20286 argv-mem=4 multi-mem=169 rbs=1024 rbp=1024 obl=45 oll=0 omem=0 tot-mem=22693 events=r cmd=exec user=default redir=-1 resp=2 lib-name= lib-ver=')
10205:M 22 Aug 2024 09:36:44.158 * CONFIG REWRITE executed with success.
10205:M 22 Aug 2024 09:36:45.160 * Replica 10.2.0.4:6380 asks for synchronization
10205:M 22 Aug 2024 09:36:45.160 * Partial resynchronization not accepted: Requested offset for second ID was 16323076746052, but I can reply up to 16323075171101
10205:M 22 Aug 2024 09:36:45.160 * Delay next BGSAVE for diskless SYNC
10205:M 22 Aug 2024 09:36:45.505 * Starting BGSAVE for SYNC with target: replicas sockets
10205:M 22 Aug 2024 09:36:45.696 * Background RDB transfer started by pid 17905
10205:M 22 Aug 2024 09:36:55.324 * Replica 10.2.0.2:6380 asks for synchronization
10205:M 22 Aug 2024 09:36:55.324 * Partial resynchronization not accepted: Requested offset for second ID was 16323081420596, but I can reply up to 16323075171101
10205:M 22 Aug 2024 09:36:55.324 * Current BGSAVE has socket target. Waiting for next BGSAVE for SYNC
17905:C 22 Aug 2024 09:40:43.626 * Fork CoW for RDB: current 527 MB, peak 527 MB, average 374 MB
10205:M 22 Aug 2024 09:40:43.626 * Diskless rdb transfer, done reading from pipe, 1 replicas still up.
10205:M 22 Aug 2024 09:40:44.079 * Background RDB transfer terminated with success
10205:M 22 Aug 2024 09:40:44.079 * Streamed RDB transfer with replica 10.2.0.4:6380 succeeded (socket). Waiting for REPLCONF ACK from replica to enable streaming
10205:M 22 Aug 2024 09:40:44.079 * Synchronization with replica 10.2.0.4:6380 succeeded
10205:M 22 Aug 2024 09:40:44.079 * Starting BGSAVE for SYNC with target: replicas sockets
10205:M 22 Aug 2024 09:40:44.380 * Background RDB transfer started by pid 18131
18131:C 22 Aug 2024 09:43:09.011 * Fork CoW for RDB: current 857 MB, peak 857 MB, average 595 MB
10205:M 22 Aug 2024 09:43:09.012 * Diskless rdb transfer, done reading from pipe, 1 replicas still up.
10205:M 22 Aug 2024 09:43:09.399 * Background RDB transfer terminated with success
10205:M 22 Aug 2024 09:43:09.399 * Streamed RDB transfer with replica 10.2.0.2:6380 succeeded (socket). Waiting for REPLCONF ACK from replica to enable streaming
10205:M 22 Aug 2024 09:43:09.399 * Synchronization with replica 10.2.0.2:6380 succeeded
some parameters from conf file
tls-replication yes
replicaof 10.2.0.3 6380
replica-read-only yes
repl-diskless-sync yes
repl-diskless-sync-delay 5
repl-diskless-sync-max-replicas 1
repl-diskless-load disabled
repl-timeout 30
repl-disable-tcp-nodelay no
repl-backlog-size 100mb
min-replicas-to-write 0
min-replicas-max-lag 5
repl-ping-replica-period 1
busy-reply-threshold 5000
client-output-buffer-limit replica 1gb 512mb 60
save 1800 500
stop-writes-on-bgsave-error yes