Uploaded image for project: 'Couchbase Server'
  1. Couchbase Server
  2. MB-7342

Touch with expiry time 0 does not work

    Details

    • Type: Bug
    • Status: Resolved
    • Priority: Blocker
    • Resolution: Fixed
    • Affects Version/s: 2.0-beta-2
    • Fix Version/s: 2.0
    • Component/s: couchbase-bucket
    • Security Level: Public
    • Labels:
      None
    • Environment:
      Couchbase server 2.0 build 1971

      Description

      According to the specification touch 0 should set the expiry time to never expire, but for couchbase buckets it cause the document to expire immediately (memcached buckets does the right thing here).

      Easy test is:
      telnet localhost 11211
      add a 1 30 1
      a
      touch a 0
      get a

      On a couchbase bucket you won't get anything back from the last get, whereas on memcached buckets you'll get the document a.

      The bug is caused by the following code in ep_engine.cc (in EventuallyPersistentEngine::touch):

      exptime = serverApi->core->abstime(serverApi->core->realtime(exptime));

      Instead the code should be:

      if (exptime != 0)

      { exptime = serverApi->core->abstime(serverApi->core->realtime(exptime)); }
      No reviews matched the request. Check your Options in the drop-down menu of this sections header.

        Activity

        Hide
        thuan Thuan Nguyen added a comment -

        Integrated in github-ep-engine-2-0 #461 (See http://qa.hq.northscale.net/job/github-ep-engine-2-0/461/)
        MB-7342: Fix touch with exp time 0 (Revision 3b59a3089bb865fc0535c288dc4977915850c480)

        Result = SUCCESS
        Trond Norbye :
        Files :

        • tests/ep_testsuite.cc
        • src/ep_engine.cc
        Show
        thuan Thuan Nguyen added a comment - Integrated in github-ep-engine-2-0 #461 (See http://qa.hq.northscale.net/job/github-ep-engine-2-0/461/ ) MB-7342 : Fix touch with exp time 0 (Revision 3b59a3089bb865fc0535c288dc4977915850c480) Result = SUCCESS Trond Norbye : Files : tests/ep_testsuite.cc src/ep_engine.cc
        Hide
        mikew Mike Wiederhold added a comment -
        Show
        mikew Mike Wiederhold added a comment - http://review.couchbase.org/#/c/23024/ Change was merged.
        Hide
        farshid Farshid Ghods (Inactive) added a comment -

        Raising this to blocker since this is a regression and it can impacts current users

        Show
        farshid Farshid Ghods (Inactive) added a comment - Raising this to blocker since this is a regression and it can impacts current users
        Show
        trond Trond Norbye added a comment - http://review.couchbase.org/23024

          People

          • Assignee:
            chiyoung Chiyoung Seo
            Reporter:
            trond Trond Norbye
          • Votes:
            0 Vote for this issue
            Watchers:
            0 Start watching this issue

            Dates

            • Created:
              Updated:
              Resolved:

              Gerrit Reviews

              There are no open Gerrit changes