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

Method Bucket::upsertMulti() Silently Fail On Locked Items

    XMLWordPrintable

Details

    • Bug
    • Resolution: Unresolved
    • Major
    • 4.2.2
    • 4.1.6
    • extension
    • None
    • 0

    Description

      For following test code

       

       

      <?php
       
      // ...
      $key1       = 'key1';
      $key2       = 'key2';
       
      $collection->upsertMulti([[$key1, 'dummy'], [$key2, 'dummy']]);
      $collection->getAndLock($key2, 10);
      $collection->upsertMulti([[$key1, 'changed'], [$key2, 'changed']]);
       
      var_dump(array_map(fn ($doc) => $doc->content(), $collection->getMulti([$key1, $key2])));

      Ideally, it should return an array of two items, where first item is a valid Couchbase document, and the 2nd one is an error document (with error code COUCHBASE_KEY_EEXISTS), as in previous major versions of Couchbase.

       

      However, it returns the following output under Couchbase v4.1.6:

       

      array(2) {
        [0]=>
        string(7) "changed"
        [1]=>
        string(5) "dummy"
      } 

      As we can see, the batch operation fails to update the 2nd item silently.

       

      Attachments

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

        Activity

          People

            avsej Sergey Avseyev
            deminy Demin Yin
            Votes:
            0 Vote for this issue
            Watchers:
            1 Start watching this issue

            Dates

              Created:
              Updated:

              Gerrit Reviews

                There are no open Gerrit changes

                PagerDuty