don't save master if host is null

Former-commit-id: 8238d8da82c483c093f5248b9dac983bc542e20f
This commit is contained in:
christianEQ 2021-11-26 20:36:46 +00:00
parent 01d54e5e40
commit e5b5099eef

View File

@ -2126,6 +2126,10 @@ void saveMasterStatusToStorage()
listRewind(g_pserver->masters,&li);
while((ln = listNext(&li)) != NULL) {
mi = (redisMaster*)listNodeValue(ln);
if (mi->masterhost == NULL) {
// if we don't know the host, no reason to save
continue;
}
if (!mi->master) {
// If master client is not available, use info from master struct - better than nothing
if (mi->master_replid[0] == 0) {