From 0f3a435f86deed2b571fd4c0edc38c206f759348 Mon Sep 17 00:00:00 2001 From: Steve Yen Date: Mon, 10 Oct 2011 10:35:39 -0700 Subject: [PATCH] cproxy_forward assert(d->upstream_conn != NULL) cproxy.c, 1925 Here's the (rather involved) scenario where the assert would be triggered... * start a rebalance. The rebalance should be slow, where each vbucket migration takes awhile. * a multi-get command (with lots of keys) is processed by moxi, and moxi scatters out downstream GET requests to the involved nodes. * one downstream request will result in a NOT_MY_VBUCKET response from a node, which will make moxi register for a retry of the command again later (XXX). * a different downstream request hits a pending vbucket, meaning it's going to block moxi on that request, so moxi can't make progress on that multi-get command. * the rebalance is going very slowly, so next... * moxi's downstream_timeout timer gets fired, so... * moxi sends an error back up to the upstream client. * THEN, since a retry was registered at step XXX above due to the NOT_MY_VBUCKET, moxi next incorrectly goes through retry codepaths and the assert() catches this bad move. Change-Id: I4aea4e130ad55bbd2400bbbcd0547a86bddbc5da Reviewed-on: http://review.couchbase.org/10039 Reviewed-by: Steve Yen Tested-by: Steve Yen --- cproxy.c | 1 + 1 file changed, 1 insertion(+) diff --git a/cproxy.c b/cproxy.c index 1d42a678..a0c51786 100644 --- a/cproxy.c +++ b/cproxy.c @@ -999,6 +999,7 @@ bool cproxy_release_downstream(downstream *d, bool force) { // be released. // if (!force && + d->upstream_conn != NULL && d->upstream_retry > 0) { d->upstream_retry = 0; d->upstream_retries++;