The problem/use-case that the feature addresses

Thinking that a master and a slave are running with some sentinels monitoring, the slave will become new master after old master crashes. However, the old master will full sync with new master even if it has loaded the data in rdb file. This full sync operation cause two things not so good as follow: 1. This full sync operation will stress new master, because it is solving request and bgsave. 2. This full sync operation will waste the time of loading data in rdb file. Note that when slave crash, it will use the replid, offset and dbid saved in rdb file, which help to psync with its master.

Description of the feature

Now the master use the replid, offset to build server.replid2 and backlog, to help its old slave psync with self. But it will full sync with new master when become slave.

Alternatives you've considered

Just like slave, the master use the replid, offset and dbid saved in rdb file to build a cache master and backlog. Considering that the user request may arrive before sentinel request, the master can be set readonly(just like slave-read-only config) and be given a timeout. Before timeout, the old master is readonly and will try pysnc with new master. After timeout, the old master will full sync will new master just like before.

Additional information

Is there some other problems preventing this feature? Thanks!