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

Error "Missmatch cas values" when using EXECUTE __update

    XMLWordPrintable

Details

    • Bug
    • Resolution: User Error
    • Major
    • 7.0.0
    • Cheshire-Cat
    • query
    • Untriaged
    • 1
    • Unknown

    Description

      My test is:

      // BEGIN WORK
      QueryResult beginWork = cluster.query("BEGIN WORK");
      String txId = beginWork.rowsAsObject().get(0).getString("txid");
       
      // EXECUTE __get and retrieve scas
      QueryResult get = cluster.query("EXECUTE __get",
      QueryOptions.queryOptions()
              .raw("txid", txId)
              .parameters(JsonArray.create()
                      .add(keyspace)
                      .add(docId)));
       
      JsonObject row = get.rowsAsObject().get(0);
      String scas = row.getString("scas");
      // scas is "1604402229268185088"
       
      // Generate txdata of 
      // {"cas":"1604402229268185088","kv":true}
      JsonObject txdata = makeTxData(Optional.of(scas), txId);
       
      // EXECUTE __update sending back that scas
      QueryResult replace = cluster.query("EXECUTE __update",
              QueryOptions.queryOptions()
                      .raw("txid", txId)
                      .raw("txdata", txdata)
                      .parameters(JsonArray.create()
                              .add(keyspace)
                              .add(docId)
                              .add(updated)
                              .add(JsonObject.create())));
      

      This results in error:

      {"code":17099,"message":"UPDATE - cause: Missmatch cas values(0,1604402229268185088) for key d29cdea4-fec7-46a3-9e5c-455c5e967fac"} 

      This is on 7.0.0-3611.

      Attachments

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

        Activity

          People

            kamini.jagtiani Kamini Jagtiani
            graham.pople Graham Pople
            Votes:
            0 Vote for this issue
            Watchers:
            3 Start watching this issue

            Dates

              Created:
              Updated:
              Resolved:

              Gerrit Reviews

                There are no open Gerrit changes

                PagerDuty