Uploaded image for project: 'Spymemcached Java Client'
  1. Spymemcached Java Client
  2. SPY-97

decode and test for unlock cases of NOT_FOUND, NOT_MY_VBUCKET and ETMPFAIL

    XMLWordPrintable

Details

    • Improvement
    • Resolution: Unresolved
    • Major
    • .next
    • 2.8.2
    • None
    • Security Level: Public
    • None

    Description

      Current unlock implementation does not read the response and do anything with it. It simply says okay for any received responses.

      Tests and implementation should check for the various responses expected. This should be documented somewhere and implementation should follow the documentation, but just to show what the current server implementation is I plucked this out of the server code for ep_engine:

      ENGINE_ERROR_CODE rv = e->unlockKey(key, vbucket, cas, ep_current_time());

      if (rv == ENGINE_SUCCESS)

      { *msg = "UNLOCKED"; }

      else if (rv == ENGINE_TMPFAIL)

      { *msg = "UNLOCK_ERROR"; res = PROTOCOL_BINARY_RESPONSE_ETMPFAIL; }

      else {
      if (e->isDegradedMode())

      { *msg = "LOCK_TMP_ERROR"; return PROTOCOL_BINARY_RESPONSE_ETMPFAIL; }

      RCPtr<VBucket> vb = e->getVBucket(vbucket);
      if (!vb)

      { *msg = "That's not my bucket."; res = PROTOCOL_BINARY_RESPONSE_NOT_MY_VBUCKET; }

      *msg = "NOT_FOUND";
      res = PROTOCOL_BINARY_RESPONSE_KEY_ENOENT;
      }

      Attachments

        For Gerrit Dashboard: SPY-97
        # Subject Branch Project Status CR V

        Activity

          People

            daschl Michael Nitschinger
            ingenthr Matt Ingenthron
            Votes:
            0 Vote for this issue
            Watchers:
            0 Start watching this issue

            Dates

              Created:
              Updated:

              Gerrit Reviews

                There are no open Gerrit changes

                PagerDuty