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

Mutation fail may not report the error

    XMLWordPrintable

Details

    • Bug
    • Resolution: Fixed
    • Major
    • 7.1.0
    • 6.6.2, Cheshire-Cat
    • query
    • Untriaged
    • 1
    • Unknown

    Description

      This code is there from 4.0.0 nothing new. It might be decision made at that time. We may need to revist.

       

      https://github.com/couchbase/query/blob/master/datastore/couchbase/couchbase.go#L1949

      performOp() function returns error at the end when len == 0
      Then caller sets based on the error.

      What happens if we updating 10 entries and 8 succeed and 2 failed. We log error but never return error to caller.

      This code needs to be revisted.

      Repro during insert case:

      delete from default;
      insert into default values("k001",1), values("k001",1); 
       
       -- success even there is primary key violation but logged in query.log
      _time=2021-06-08T13:58:57.717-07:00 _level=ERROR _msg=Failed to perform INSERT on key <ud>k001</ud> for Keyspace default:default._default._default. Error - <ud>Duplicate Key k001</ud>
       
      insert into default values("k001",1);  -- 12009 error
      insert into default values("k001",{"a":1}), values("k003",{"a":1}) ; -- success  (even though primary key violation one key)
      
      

      Same thing can happen for cas mismatch of UPDATE

      Attachments

        Issue Links

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

          Activity

            People

              pierre.regazzoni Pierre Regazzoni
              Sitaram.Vemulapalli Sitaram Vemulapalli
              Votes:
              0 Vote for this issue
              Watchers:
              6 Start watching this issue

              Dates

                Created:
                Updated:
                Resolved:

                PagerDuty