From 2451fce391d76deb1f3b594a4e6a461e14f97584 Mon Sep 17 00:00:00 2001 From: Chris Rice Date: Tue, 3 Sep 2024 09:30:54 -0700 Subject: [PATCH] Add 'slave_repl_offset' to the INFO replication command output --- internal/server/stats.go | 1 + 1 file changed, 1 insertion(+) diff --git a/internal/server/stats.go b/internal/server/stats.go index 0da0791d..74b4d461 100644 --- a/internal/server/stats.go +++ b/internal/server/stats.go @@ -450,6 +450,7 @@ func (s *Server) writeInfoReplication(w *bytes.Buffer) { fmt.Fprintf(w, "role:slave\r\n") fmt.Fprintf(w, "master_host:%s\r\n", s.config.followHost()) fmt.Fprintf(w, "master_port:%v\r\n", s.config.followPort()) + fmt.Fprintf(w, "slave_repl_offset:%v\r\n", int(s.faofsz)) if s.config.replicaPriority() >= 0 { fmt.Fprintf(w, "slave_priority:%v\r\n", s.config.replicaPriority()) }