don't save master if host is null
Former-commit-id: 8238d8da82c483c093f5248b9dac983bc542e20f
This commit is contained in:
parent
01d54e5e40
commit
e5b5099eef
@ -2126,6 +2126,10 @@ void saveMasterStatusToStorage()
|
|||||||
listRewind(g_pserver->masters,&li);
|
listRewind(g_pserver->masters,&li);
|
||||||
while((ln = listNext(&li)) != NULL) {
|
while((ln = listNext(&li)) != NULL) {
|
||||||
mi = (redisMaster*)listNodeValue(ln);
|
mi = (redisMaster*)listNodeValue(ln);
|
||||||
|
if (mi->masterhost == NULL) {
|
||||||
|
// if we don't know the host, no reason to save
|
||||||
|
continue;
|
||||||
|
}
|
||||||
if (!mi->master) {
|
if (!mi->master) {
|
||||||
// If master client is not available, use info from master struct - better than nothing
|
// If master client is not available, use info from master struct - better than nothing
|
||||||
if (mi->master_replid[0] == 0) {
|
if (mi->master_replid[0] == 0) {
|
||||||
|
Loading…
x
Reference in New Issue
Block a user