Two part issue: 1) It appears that the documentation for the INFO command is out-of-date. Not all metrics are described (specifically "repl_backlog_*").

2) I have a test deployment of a redis cluster with 3 shards / 2 replicas per shard. There's a total of 7 keys in shard0 and both the master and slave appear to be in sync (by manually examining each). But the metrics below for the master appear to show that there is still a replication backlog.

$ redis-cli -p 6400 info replication
# Replication
role:master
connected_slaves:1
slave0:ip=127.0.0.1,port=6401,state=online,offset=355768,lag=1
master_replid:293119502fdff7a8421970a4c27b587fdd173e55
master_replid2:0000000000000000000000000000000000000000
master_repl_offset:355768
second_repl_offset:-1
repl_backlog_active:1
repl_backlog_size:1048576
repl_backlog_first_byte_offset:1
repl_backlog_histlen:355768

$ redis-cli -p 6401 info replication  
# Replication
role:slave
master_host:127.0.0.1
master_port:6400
master_link_status:up
master_last_io_seconds_ago:9
master_sync_in_progress:0
slave_repl_offset:356020
slave_priority:100
slave_read_only:1
connected_slaves:0
master_replid:293119502fdff7a8421970a4c27b587fdd173e55
master_replid2:0000000000000000000000000000000000000000
master_repl_offset:356020
second_repl_offset:-1
repl_backlog_active:1
repl_backlog_size:1048576
repl_backlog_first_byte_offset:15
repl_backlog_histlen:356006

Can someone interpret this for me? repl_backlog_size: 1048576 seems to imply that there is still data that needs to be replicated to a slave. What I'd really like to be able to track is if a slave is fully synchronized with its master.

Comment From: WJWH

Just from the looks of it, repl_backlog_sizeis more the size reserved for the backlog than any actual data. I think this both because repl_backlog_size is exactly the same for both master and slave (and what would it even mean for the master to have a replication backlog?) and because its value is exactly 1024^2.

Comment From: jonahharris

repl_backlog_size has default, compile-time definition, in server.h of:

#define CONFIG_DEFAULT_REPL_BACKLOG_SIZE (1024*1024) /* 1mb */

While this can be overridden both online and in a configuration file, it will always be > 16kB. AFAIK, this has nothing (directly) to do with determining lag/sync, although it can affect PSYNC synchronization. For that, I believe what you're looking for is the difference between master_repl_offset (on the master) and the master's shown offset of slave0. In your example, both are equal and, hence, in sync.

Comment From: filipecosta90

@itamarhaber I believe we can close this one given the INFO command docs are up to date https://redis.io/commands/info. WDYT?

Comment From: oranagra

for the record, I don't think all the fields in INFO must be documented. some are for internal use and debugging, others are to be used by the testing. The ones that are important for users (user apps, client libraries, and hosting admins) should be documented, for others, the more advanced users can dig into the code to understand how to interpret them, or they may only be important for debugging crashes and such.