From 80d4c52cdfeaee480ad81c682f914ade88dbc620 Mon Sep 17 00:00:00 2001 From: antirez Date: Wed, 26 Mar 2014 12:09:38 +0100 Subject: [PATCH] Cluster: better logging for clusterUpdateSlotsConfigWith(). --- src/cluster.c | 16 +++++++++++++--- 1 file changed, 13 insertions(+), 3 deletions(-) diff --git a/src/cluster.c b/src/cluster.c index fa226b98..fa1b0f40 100644 --- a/src/cluster.c +++ b/src/cluster.c @@ -1110,6 +1110,11 @@ void clusterUpdateSlotsConfigWith(clusterNode *sender, uint64_t senderConfigEpoc * interested to check if slots are taken away from curmaster. */ curmaster = nodeIsMaster(myself) ? myself : myself->slaveof; + if (sender == myself) { + redisLog(REDIS_WARNING,"Discarding UPDATE message about myself."); + return; + } + for (j = 0; j < REDIS_CLUSTER_SLOTS; j++) { if (bitmapTestBit(slots,j)) { /* The slot is already bound to the sender of this message. */ @@ -1137,9 +1142,14 @@ void clusterUpdateSlotsConfigWith(clusterNode *sender, uint64_t senderConfigEpoc sender != myself) { redisLog(REDIS_WARNING, - "I received a slot update for a slot I've still " - "keys into. Putting the slot in IMPORTING state. " - "Please run the 'redis-trib fix' command."); + "I received an update for slot %d. " + "%.40s claims it with config %llu, " + "I've it assigned to myself with config %llu. " + "I've still keys about this slot! " + "Putting the slot in IMPORTING state. " + "Please run the 'redis-trib fix' command.", + j, sender->name, senderConfigEpoch, + myself->configEpoch); server.cluster->importing_slots_from[j] = sender; }