Uploaded image for project: 'Couchbase PHP client library'
  1. Couchbase PHP client library
  2. PCBC-154

test for touch with expiration needs updating (maybe)

    Details

    • Type: Bug
    • Status: Resolved
    • Priority: Major
    • Resolution: Won't Fix
    • Affects Version/s: None
    • Fix Version/s: None
    • Component/s: library
    • Security Level: Public
    • Labels:
      None

      Description

      I'm really not sure what the behavior should be, but it's worth clarifying.

      What does touch with an argument of 0 imply – it is effectively a delete.

      Perhaps this should be a warning etc?

      Please post your comments.

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

        Activity

        Hide
        ingenthr Matt Ingenthron added a comment -

        Given that using an expiration of 0 means "forever", I would think a touch of 0 would extend the time to forever.

        In fact, the documentation says that:
        http://www.couchbase.com/docs/couchbase-devguide-2.0/cb-touch.html

        Trond: can you verify we do the right thing here?

        Show
        ingenthr Matt Ingenthron added a comment - Given that using an expiration of 0 means "forever", I would think a touch of 0 would extend the time to forever. In fact, the documentation says that: http://www.couchbase.com/docs/couchbase-devguide-2.0/cb-touch.html Trond: can you verify we do the right thing here?
        Hide
        ingenthr Matt Ingenthron added a comment -

        See also a commit in limbo:
        http://review.couchbase.org/#/c/21848/

        Show
        ingenthr Matt Ingenthron added a comment - See also a commit in limbo: http://review.couchbase.org/#/c/21848/
        Hide
        trond Trond Norbye added a comment -

        This is not a bug in the PHP extension, but a bug in the server. I filed MB-7342 for the issue.

        Show
        trond Trond Norbye added a comment - This is not a bug in the PHP extension, but a bug in the server. I filed MB-7342 for the issue.
        Hide
        ingenthr Matt Ingenthron added a comment -

        Thanks for getting that addressed Trond.

        Show
        ingenthr Matt Ingenthron added a comment - Thanks for getting that addressed Trond.
        Hide
        ingenthr Matt Ingenthron added a comment -

        The underlying question on this test has been resolved. There was a server bug and a touch with expiration of 0 should not return an error, but should rather extend it from whatever the current time is to forever.

        A good functional test would be:

        • Set with expiration of 3 secs
        • Touch with expiration of 0
        • Check 3 secs later to see if it's still there.
        Show
        ingenthr Matt Ingenthron added a comment - The underlying question on this test has been resolved. There was a server bug and a touch with expiration of 0 should not return an error, but should rather extend it from whatever the current time is to forever. A good functional test would be: Set with expiration of 3 secs Touch with expiration of 0 Check 3 secs later to see if it's still there.
        Hide
        ingenthr Matt Ingenthron added a comment -

        Trond: can you review what, if anything more, needs to be done here? I think it's closeable.

        Show
        ingenthr Matt Ingenthron added a comment - Trond: can you review what, if anything more, needs to be done here? I think it's closeable.
        Hide
        trond Trond Norbye added a comment -

        I verified that this worked as intended in a test program. I don't want to add more tests than necessary to the test suite that does sleep, and this test is not testing the client but verifies the server and should therefore be done elsewhere...

        Show
        trond Trond Norbye added a comment - I verified that this worked as intended in a test program. I don't want to add more tests than necessary to the test suite that does sleep, and this test is not testing the client but verifies the server and should therefore be done elsewhere...

          People

          • Assignee:
            trond Trond Norbye
            Reporter:
            mnunberg Mark Nunberg
          • Votes:
            0 Vote for this issue
            Watchers:
            2 Start watching this issue

            Dates

            • Created:
              Updated:
              Resolved:

              Gerrit Reviews

              There are no open Gerrit changes