Skip to content

Commit 21280ab

Browse files
authored
Merge pull request #732 from Netflix/dev
Merge dev into v0.6
2 parents 1da0457 + ef9060c commit 21280ab

File tree

4 files changed

+12
-1
lines changed

4 files changed

+12
-1
lines changed

src/dyn_client.c

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1230,6 +1230,7 @@ static struct msg *all_rspmgrs_get_response(struct context *ctx, struct msg *req
12301230
continue;
12311231
} else {
12321232
ASSERT(rsp->is_error == false);
1233+
12331234
// If the DCs we've processed so far have not seen errors, we need to
12341235
// make sure that the remaining DCs don't have errors too.
12351236
dc_rsp = rspmgr_get_response(ctx, rspmgr);
@@ -1259,11 +1260,14 @@ static struct msg *all_rspmgrs_get_response(struct context *ctx, struct msg *req
12591260
static rstatus_t msg_each_quorum_rsp_handler(struct context *ctx, struct msg *req,
12601261
struct msg *rsp) {
12611262

1262-
if (all_rspmgrs_done(ctx, req->additional_each_rspmgrs)) return swallow_extra_rsp(req, rsp);
1263+
if (all_rspmgrs_done(ctx, req->additional_each_rspmgrs)) {
1264+
return swallow_extra_rsp(req, rsp);
1265+
}
12631266

12641267
int rspmgr_idx = -1;
12651268
struct conn *rsp_conn = rsp->owner;
12661269
if (rsp_conn == NULL) {
1270+
// TODO: We should remove this case. Test and confirm.
12671271
rspmgr_idx = 0;
12681272
} else if (rsp_conn->type == CONN_DNODE_PEER_SERVER) {
12691273
struct node *peer_instance = (struct node*) rsp_conn->owner;

src/dyn_dnode_peer.c

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -316,6 +316,7 @@ static void dnode_peer_ack_err(struct context *ctx, struct conn *conn,
316316
rsp->dyn_error_code = req->dyn_error_code = PEER_CONNECTION_REFUSE;
317317
rsp->dmsg = dmsg_get();
318318
rsp->dmsg->id = req->id;
319+
rsp->owner = conn;
319320

320321
log_info("%s Closing req %u:%u len %" PRIu32 " type %d %c %s",
321322
print_obj(conn), req->id, req->parent_id, req->mlen, req->type,

src/dyn_message.c

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -833,6 +833,11 @@ uint32_t msg_payload_crc32(struct msg *rsp) {
833833
the beginning of the first mbuf */
834834
bool start_found = rsp->dmsg ? false : true;
835835

836+
// If the message is from another DC, the mbufs will have the decrypted
837+
// payload without the Dynomite header, so we do have the start.
838+
// rsp->dmsg->payload for cross DC msgs will have the encrypted payload.
839+
if (rsp->dmsg && !rsp->owner->same_dc) start_found = true;
840+
836841
STAILQ_FOREACH(mbuf, &rsp->mhdr, next) {
837842
uint8_t *start = mbuf->start;
838843
uint8_t *end = mbuf->last;

src/dyn_server.c

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -197,6 +197,7 @@ static void server_ack_err(struct context *ctx, struct conn *conn,
197197
rsp->error_code = req->error_code = conn->err;
198198
rsp->dyn_error_code = req->dyn_error_code = STORAGE_CONNECTION_REFUSE;
199199
rsp->dmsg = NULL;
200+
rsp->owner = conn;
200201
log_debug(LOG_DEBUG, "%s <-> %s", print_obj(req), print_obj(rsp));
201202

202203
log_info("close %s req %s len %" PRIu32 " from %s %c %s", print_obj(conn),

0 commit comments

Comments
 (0)