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

USE KEYS with empty string returns error EINVAL

    XMLWordPrintable

Details

    • Bug
    • Status: Closed
    • Critical
    • Resolution: Fixed
    • 5.5.0
    • 6.5.0, 6.0.0, 5.5.2
    • query
    • None
    • Untriaged
    • Yes

    Description

      The following query returns error in 5.5.x by KV. This is regression.

      empty string is not valid META().id but this result in bigger issues with customers particularly with JOINs. The working queries start failing. We need to treat this is not qualified.

        SELECT * 
          FROM default USE KEYS "";
      "errors": [
              {
                  "code": 12008,
                  "msg": "Error performing bulk get operation  - cause: MCResponse status=EINVAL, opcode=GET, opaque=0, msg: "
              }
          ],
      
      

      Example :
      The following query use to work and return 1 row and now it gives error. As JOIN condition k2 is not satisfied it should not give a row, it is NOT ERROR.

      insert into default values("1",{"k1":"n007", "k2":"", "k3":"n0071", "k4":["n007","n006"]});
      insert into default values("1",{"k1":"n007", "k2":"n008", "k3":"n0071", "k4":["n007","n006"]});
      insert into default values("n008",{"name":"hello"});
       
      select * from default d  JOIN default d2 ON KEYS d.k2 ;
      
      

      https://forums.couchbase.com/t/n1ql-query-stops-working-in-5-5-1-but-was-working-in-5-0-1/18408

      Attachments

        Issue Links

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

          Activity

            Isha Kandaswamy : Please check with the old build and determine which merge caused the regression? Thaks.

            keshav Keshav Murthy added a comment - Isha Kandaswamy : Please check with the old build and determine which merge caused the regression? Thaks.

            The reason use to work earlier is as follows

            • We Fetch the documents by vBucket groups
            • If one of vBucket group got error and it is *gomemcached.MCResponse, some of them we refresh and retry. some of them we propagate top. During that process we return err but never use to put in err channel.
            • This causes caller need to ignore the keys of this vBucket.

            This has been fixed in Mad-Hatter at https://github.com/couchbase/go-couchbase/blob/master/client.go#L402

            Sitaram.Vemulapalli Sitaram Vemulapalli added a comment - The reason use to work earlier is as follows We Fetch the documents by vBucket groups If one of vBucket group got error and it is *gomemcached.MCResponse, some of them we refresh and retry. some of them we propagate top. During that process we return err but never use to put in err channel. This causes caller need to ignore the keys of this vBucket. This has been fixed in Mad-Hatter at https://github.com/couchbase/go-couchbase/blob/master/client.go#L402

            Build couchbase-server-6.0.0-1642 contains go-couchbase commit 9b37399 with commit message:
            MB-31307. Skip empty key fetch (treat as not found)

            build-team Couchbase Build Team added a comment - Build couchbase-server-6.0.0-1642 contains go-couchbase commit 9b37399 with commit message: MB-31307 . Skip empty key fetch (treat as not found)
            wayne Wayne Siu added a comment -

            Adding it to 5.5.2

            wayne Wayne Siu added a comment - Adding it to 5.5.2

            Build couchbase-server-5.5.2-3731 contains go-couchbase commit 67df832 with commit message:
            MB-31307. Skip empty key fetch (treat as not found)

            build-team Couchbase Build Team added a comment - Build couchbase-server-5.5.2-3731 contains go-couchbase commit 67df832 with commit message: MB-31307 . Skip empty key fetch (treat as not found)

            Build couchbase-server-6.5.0-1322 contains go-couchbase commit 031fc5f with commit message:
            MB-31307. Skip empty key fetch (treat as not found)

            build-team Couchbase Build Team added a comment - Build couchbase-server-6.5.0-1322 contains go-couchbase commit 031fc5f with commit message: MB-31307 . Skip empty key fetch (treat as not found)
            ajay.bhullar Ajay Bhullar added a comment -

            verified in 5.5.2-3733

            ajay.bhullar Ajay Bhullar added a comment - verified in 5.5.2-3733

            Build sync_gateway-2.5.0-134 contains go-couchbase commit 031fc5f with commit message:
            MB-31307. Skip empty key fetch (treat as not found)

            build-team Couchbase Build Team added a comment - Build sync_gateway-2.5.0-134 contains go-couchbase commit 031fc5f with commit message: MB-31307 . Skip empty key fetch (treat as not found)

            People

              ajay.bhullar Ajay Bhullar
              Sitaram.Vemulapalli Sitaram Vemulapalli
              Votes:
              0 Vote for this issue
              Watchers:
              5 Start watching this issue

              Dates

                Created:
                Updated:
                Resolved:

                Gerrit Reviews

                  There are no open Gerrit changes

                  PagerDuty