Skip to content

Commit

Permalink
cproxy_forward assert(d->upstream_conn != NULL) cproxy.c, 1925
Browse files Browse the repository at this point in the history
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 <steve.yen@gmail.com>
Tested-by: Steve Yen <steve.yen@gmail.com>
  • Loading branch information
steveyen committed Oct 29, 2011
1 parent 1853268 commit 0f3a435
Showing 1 changed file with 1 addition and 0 deletions.
1 change: 1 addition & 0 deletions cproxy.c
Expand Up @@ -999,6 +999,7 @@ bool cproxy_release_downstream(downstream *d, bool force) {
// be released. // be released.
// //
if (!force && if (!force &&
d->upstream_conn != NULL &&
d->upstream_retry > 0) { d->upstream_retry > 0) {
d->upstream_retry = 0; d->upstream_retry = 0;
d->upstream_retries++; d->upstream_retries++;
Expand Down

0 comments on commit 0f3a435

Please sign in to comment.