From 6669d74d4940ba064b099b1fb169d78ce38d62b2 Mon Sep 17 00:00:00 2001 From: Sailesh Mukil Date: Thu, 31 Oct 2019 15:10:36 -0700 Subject: [PATCH] Multiple rspmgrs get assigned the same DC name under DC_EACH_SAFE_QUORUM This bug caused some DCs to be ignored, also leading to non-deterministic crashes. This fixes the bug by assuring each rspmgr is assigned the correct name under a request msg. --- src/dyn_response_mgr.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/dyn_response_mgr.c b/src/dyn_response_mgr.c index 9a9394423..aa1bc636d 100644 --- a/src/dyn_response_mgr.c +++ b/src/dyn_response_mgr.c @@ -24,13 +24,13 @@ rstatus_t init_response_mgr_all_dcs(struct context *ctx, struct msg *req, // Initialize the response managers for all remote DCs. (The 0th idx in the // 'additional_each_rspmgrs' array is reserved for the local DC). int i; + uint32_t dc_idx = 0; for (i = 1; i < num_dcs_in_quorum; ++i) { req->additional_each_rspmgrs[i] = (struct rspmgr*) dn_alloc(sizeof(struct response_mgr)); if (req->additional_each_rspmgrs[i] == NULL) { goto enomem; } - uint32_t dc_idx = 0; struct datacenter *remote_dc = NULL; do { remote_dc = (struct datacenter*) array_get(&ctx->pool.datacenters, dc_idx);