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

Touch with expiry time 0 does not work

    XMLWordPrintable

Details

    • Bug
    • Resolution: Fixed
    • Blocker
    • 2.0
    • 2.0-beta-2
    • couchbase-bucket
    • Security Level: Public
    • None
    • 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)); }

      Attachments

        For Gerrit Dashboard: MB-7342
        # Subject Branch Project Status CR V

        Activity

          People

            chiyoung Chiyoung Seo (Inactive)
            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

                PagerDuty