Skip to content
Browse files

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-by: Steve Yen <>
Tested-by: Steve Yen <>
  • Loading branch information...
1 parent 1853268 commit 0f3a435f86deed2b571fd4c0edc38c206f759348 @steveyen steveyen committed Oct 10, 2011
Showing with 1 addition and 0 deletions.
  1. +1 −0 cproxy.c
1 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;

0 comments on commit 0f3a435

Please sign in to comment.
Something went wrong with that request. Please try again.