{"id":"923c7c2b1d71f6e5","repo":"redis/redis","slug":"warning-cluster-slots-configuration-changed-fetc","errorCode":null,"errorMessage":"WARNING: Cluster slots configuration changed, fetching new one...\\n","messagePattern":"WARNING: Cluster slots configuration changed, fetching new one\\.\\.\\.\\\\n","errorType":"console","errorClass":null,"httpStatus":null,"severity":"info","filePath":"src/redis-benchmark.c","lineNumber":1276,"sourceCode":"    return success;\n}\n\n/* Request the current cluster slots configuration by calling CLUSTER SLOTS\n * and atomically update the slots after a successful reply. */\nstatic int fetchClusterSlotsConfiguration(client c) {\n    UNUSED(c);\n    int success = 1, is_fetching_slots = 0, last_update = 0;\n    size_t i;\n    atomicGet(config.slots_last_update, last_update);\n    if (c->slots_last_update < last_update) {\n        c->slots_last_update = last_update;\n        return -1;\n    }\n    redisReply *reply = NULL;\n    atomicGetIncr(config.is_fetching_slots, is_fetching_slots, 1);\n    if (is_fetching_slots) return -1; //TODO: use other codes || errno ?\n    atomicSet(config.is_fetching_slots, 1);\n    fprintf(stderr,\n            \"WARNING: Cluster slots configuration changed, fetching new one...\\n\");\n    const char *errmsg = \"Failed to update cluster slots configuration\";\n    static dictType dtype = {\n        dictSdsHash,               /* hash function */\n        NULL,                      /* key dup */\n        NULL,                      /* val dup */\n        dictSdsKeyCompare,         /* key compare */\n        NULL,                      /* key destructor */\n        NULL,                      /* val destructor */\n        NULL                       /* allow to expand */\n    };\n    /* printf(\"[%d] fetchClusterSlotsConfiguration\\n\", c->thread_id); */\n    dict *masters = dictCreate(&dtype);\n    redisContext *ctx = NULL;\n    for (i = 0; i < (size_t) config.cluster_node_count; i++) {\n        clusterNode *node = config.cluster_nodes[i];\n        assert(node->ip != NULL);\n        assert(node->name != NULL);","sourceCodeStart":1258,"sourceCodeEnd":1294,"githubUrl":"https://github.com/redis/redis/blob/3acc0c49cf5ad2af9425d333e62728342dd6159b/src/redis-benchmark.c#L1258-L1294","documentation":"Emitted at the top of fetchClusterSlotsConfiguration() (redis-benchmark.c:1276) when a benchmark worker thread detects that the cluster's slot-to-node mapping has changed since its last fetch (via the atomic slots_last_update timestamp set by other threads after a topology change). Because the benchmark must route each command to the correct node via the slot hash, a stale map would cause MOVED/ASK redirections and corrupt results, so it re-issues CLUSTER SLOTS against the first known node. This is an informational notice, not a failure.","triggerScenarios":"Produced only in --cluster mode at runtime when config.slots_last_update advances past the per-client c->slots_last_update, i.e. another thread already updated the global slot map after a MOVED was observed. The function then wins the atomic is_fetching_slots flag and logs the message before issuing the CLUSTER SLOTS command. It will recur each time slot ownership changes during the benchmark run.","commonSituations":"Running a long benchmark against a cluster that is being actively resharded, scaled out, or failed over; a cluster with unstable nodes causing frequent failover; multiple benchmark threads racing where one triggers a refresh that others pick up. Expected and benign during elasticity operations.","solutions":["If the cluster is being intentionally resharded/failover-tested, ignore this message; it indicates correct auto-refresh behavior.","Stabilize the cluster topology before benchmarking for clean numbers: finish resharding, wait for failover to settle, then re-run.","Reduce benchmark duration so it is less likely to span a topology change.","Confirm with CLUSTER INFO that cluster_state is ok and cluster_slots_assigned == 16384 before running."],"exampleFix":"# before: benchmarking during an active reshard (frequent refresh notices)\nredis-cli --cluster reshard 127.0.0.1:7000 ... &\nredis-benchmark --cluster -h 127.0.0.1 -p 7000 -n 1000000\n\n# after: stabilize first, then benchmark\nredis-cli --cluster check 127.0.0.1:7000  # ensure cluster_state:ok\nredis-benchmark --cluster -h 127.0.0.1 -p 7000 -n 1000000","handlingStrategy":"retry","validationCode":"# Confirm cluster is stable (no ongoing slot migration) before running:\nredis-cli -c -h $HOST -p $PORT cluster info | grep -E 'cluster_state:ok|cluster_slots_migrating:0|cluster_slots_importing:0'","typeGuard":null,"tryCatchPattern":null,"preventionTips":["Do not run redis-benchmark during reshard, failover, or node add/remove — those mutate the slot map.","Verify `cluster_state:ok` and zero migrating/importing slots via `CLUSTER INFO` before each benchmark run.","Re-run the benchmark if topology changed; the tool refetches the config but mid-flight churn still skews results."],"tags":["redis","cluster","benchmark","cluster-slots","redis-benchmark"],"analyzedSha":"3acc0c49cf5ad2af9425d333e62728342dd6159b","analyzedAt":"2026-08-01T22:07:56.715Z","schemaVersion":2}