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

RYOW Semantics do not work with 2i GSI & REQUEST_PLUS

    XMLWordPrintable

Details

    • Untriaged
    • Unknown

    Description

      Preface: I've marked it as a blocker for DP because I think it needs awareness and decisions on how we are proceeding for DP. Feel free to lower the priority once we know what to do.

      I'm on build 1757.

      As part of the DP docs, the SDK team is working on RYOW examples in each language. The Java code looks like this:

       
          public static void main(String[] args) {
              // Connect to the Cluster
              Cluster cluster = CouchbaseCluster.create();
              // Open the travel-sample bucket
              Bucket bucket = cluster.openBucket("travel-sample");
       
              // Create a new airline (document)
              bucket.upsert(JsonDocument.create("airline_000", JsonObject.create()
                      .put("id", "000")
                      .put("type", "airline")
                      .put("name", "Couchbase Airways")
                      .put("iata", "CBX")
                      .put("icao", "CBX")
                      .put("callsign", "COUCH-BASE")
                      .put("country", "United States")
              ));
       
              // Perform the Query
              QueryResult result = bucket.query(
                  Query.simple(select("*").from(i(bucket.name())).where(x("iata").eq(s("CBX"))),
                  QueryParams.build().consistency(ScanConsistency.REQUEST_PLUS))
              );
       
              // Prints
              // [{"country":"United States","iata":"CBX",...,"icao":"CBX","id":"000","type":"airline"}]
              System.out.println(result.allRows());
          }
      

      Now here is the problem: when using GSI on an index (I've used a primary index, but I don't think it matters), the result returns an empty row set, which means for some reason the previous write was not reflected in the query.

      When I use a view-backed index all works as expected.

      The misbehaving index in question is (out put from system:indexes):

               "indexes": {
                      "datastore_id": "http://127.0.0.1:8091",
                      "id": "8e3a7900de0b7b73",
                      "index_key": [],
                      "keyspace_id": "travel-sample",
                      "name": "def_primary",
                      "namespace_id": "default",
                      "state": "online",
                      "using": "gsi"
                  }
      

      .. when I do the query a second time the result shows up, which indicates there is indeed a time gap. Why does 2i does not pick up the latest and greatest sequence numbers when I issue a query with Request_plus?

      Attachments

        1. Archive.zip
          1.21 MB
        2. ArchiveCleanInstall.zip
          161 kB
        3. client-logs.txt
          36 kB
        4. client-logs-finest.txt
          105 kB
        5. log.zip
          26.61 MB
        6. new-log.zip
          29.66 MB
        7. ryow.pcapng
          2.13 MB

        Issue Links

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

          Activity

            People

              daschl Michael Nitschinger
              daschl Michael Nitschinger
              Votes:
              0 Vote for this issue
              Watchers:
              13 Start watching this issue

              Dates

                Created:
                Updated:
                Resolved:

                Gerrit Reviews

                  There are no open Gerrit changes

                  PagerDuty