Comment From: JohnSully

That's how Redis checks if the replicas are still attached. Any message to the replica goes through the repl backlog.

Comment From: jonasmao

@JohnSully thanks for answering。but backlog will use for the “PartialResynchronization” with replicas who know “PSYNC”。 I just want know append “PING” cmd is for unified coding or others

Comment From: trevor211

Do you still have some questions about it after @JohnSully 's anwser?

Comment From: oranagra

@jonasmao The PING is also sent to replicas which cause them to increment their replication offset, so it needs to be appended to the backlog too otherwise the offset they'll request at PSYNC will not match a valid backlog offset.

In redis 6.0 there was an attempt to exclude trailing PINGS from the replication offset and trim them from the backlog at certain times (see "meaningful repl offset"), but it caused some issues and was eventually dropped in 6.0.4.

We do have a future plan to separate the replication stream to several sub-channels multiplexed together, doing this will let us exclude the PINGs from the backlog and replication offset.

I'm closing this issue, but feel free to ask more questions or re-open if you have further queries.