Skip to content

Commit

Permalink
Pick up cookies from pending buffer unless node connected
Browse files Browse the repository at this point in the history
Change-Id: I645ab4557901b480f70c23b56e38c63e0222d888
Reviewed-on: http://review.couchbase.org/14337
Tested-by: Sergey Avseyev <sergey.avseyev@gmail.com>
Reviewed-by: Trond Norbye <trond.norbye@gmail.com>
  • Loading branch information
avsej authored and trondn committed Mar 27, 2012
1 parent c32fdae commit 463958d
Showing 1 changed file with 5 additions and 1 deletion.
6 changes: 5 additions & 1 deletion src/instance.c
Expand Up @@ -381,7 +381,11 @@ static void relocate_packets(libcouchbase_server_t *src,
vb = ntohs(cmd.request.vbucket);
idx = (libcouchbase_size_t)vbucket_get_master(dst_instance->vbucket_config, vb);
dst = dst_instance->servers + idx;
assert(ringbuffer_read(&src->output_cookies, &ct, sizeof(ct)) == sizeof(ct));
if (src->connected) {
assert(ringbuffer_read(&src->output_cookies, &ct, sizeof(ct)) == sizeof(ct));
} else {
assert(ringbuffer_read(&src->pending_cookies, &ct, sizeof(ct)) == sizeof(ct));
}

assert(ringbuffer_ensure_capacity(&dst->cmd_log, npacket));
assert(ringbuffer_write(&dst->cmd_log, cmd.bytes, sizeof(cmd.bytes)) == sizeof(cmd.bytes));
Expand Down

0 comments on commit 463958d

Please sign in to comment.