Uploaded image for project: 'Couchbase .NET client library'
  1. Couchbase .NET client library
  2. NCBC-555

Multi get can fail and return a null StatusCode

    XMLWordPrintable

    Details

    • Type: Bug
    • Status: Resolved
    • Priority: Major
    • Resolution: Fixed
    • Affects Version/s: 1.3.7
    • Fix Version/s: 1.3.8
    • Component/s: library
    • Environment:
      Server: 2.5.1 cluster - 3 nodes. 1 bucket
      Client: Windows 7 (VM), VS Express 2013, CouchBase .NET SDK 1.3.7, .NET 3.5 or 4

      Description

      Found that performing a multi-get during a rebalance had a couple of issue when the code returns from the following line.

      https://github.com/couchbase/couchbase-net-client/blob/4642a9d3ef32d5a00bcb458f108c8c002c4b1535/src/Enyim.Caching/Memcached/Protocol/Binary/MultiGetOperation.cs#L185

      Client code is using client.ExecuteGet(<array of keys>)

      The main issue is that the 'result.Fail' ends up back with the client and StatusCode == null, even though there's a "not my vbucket" status (7) in response.StatusCode.

      Minor issue is that the result.Fail message doesn't get formatted to include the correlationId, always prints

      {0}

      .

      I've a draft patch that ensures the StatusCode is passed through so that the client can see the failure is not-my-vbucket and issue a retry.

      With my draft patch though I couldn't seem to get the StatusCode passed through without creating an "rv" and returning that.

      Basically:

      result.StatusCode = response.StatusCode;
      return result.Fail(...);

      and

      this.StatusCode = response.StatusCode;
      return result.Fail(...)

      still returned StatusCode of null?

      (patch attached soon)

        Attachments

        No reviews matched the request. Check your Options in the drop-down menu of this sections header.

          Activity

          Hide
          jwalker Jim Walker added a comment -

          Patch (researching appropriate test cases now....)

          http://review.couchbase.org/#/c/39540/

          With this patch and clients checking for not-my-vbucket all is well.

          Show
          jwalker Jim Walker added a comment - Patch (researching appropriate test cases now....) http://review.couchbase.org/#/c/39540/ With this patch and clients checking for not-my-vbucket all is well.
          Hide
          jwalker Jim Walker added a comment -

          Previous patch abandoned. This one is a touch tidier

          http://review.couchbase.org/#/c/39590

          Regarding test-cases, this looks to be covered already but requires a careful rebalance timed with the correct test.

          E.g. something like

          When_Getting_Multiple_Existing_Keys_Result_Is_Successful()

          Show
          jwalker Jim Walker added a comment - Previous patch abandoned. This one is a touch tidier http://review.couchbase.org/#/c/39590 Regarding test-cases, this looks to be covered already but requires a careful rebalance timed with the correct test. E.g. something like When_Getting_Multiple_Existing_Keys_Result_Is_Successful()
          Hide
          jwalker Jim Walker added a comment -

          Correct branch this time!

          http://review.couchbase.org/39658

          Show
          jwalker Jim Walker added a comment - Correct branch this time! http://review.couchbase.org/39658
          Hide
          jmorris Jeff Morris added a comment -

          6296799ab4e2b43dd0fff1643627aa65f539c195

          Show
          jmorris Jeff Morris added a comment - 6296799ab4e2b43dd0fff1643627aa65f539c195

            People

            Assignee:
            jwalker Jim Walker
            Reporter:
            jwalker Jim Walker
            Votes:
            0 Vote for this issue
            Watchers:
            3 Start watching this issue

              Dates

              Created:
              Updated:
              Resolved:

                Gerrit Reviews

                  PagerDuty