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

Few updates goes missing in N1ql txn

    XMLWordPrintable

Details

    • Untriaged
    • 1
    • Yes

    Description

      When Insert statement fails with "Duplicate Key" error, update happens before the insert statement are not seen after commit.

      Executed on build 7.0.0-4122

      Queries:

      1. begin work;
      2.SAVEPOINT a0;
      3. INSERT INTO default:`9dGcEmYNseE6iW2A5Ea-4-854000`.`_default`.`_default` (KEY k1, value t) SELECT DISTINCT t.name AS k1,t FROM default:`9dGcEmYNseE6iW2A5Ea-4-854000`.`_default`.`_default` t WHERE  job_title='Pre-Sales' LIMIT 10 RETURNING *;
       SAVEPOINT a1;
      4. UPDATE default:`9dGcEmYNseE6iW2A5Ea-4-854000`.`_default`.`_default` USE KEYS  ['test_collections-226', 'test_collections-1082', 'test_collections-1677', 'test_collections-1626', 'test_collections-1602', 'test_collections-839', 'test_collections-917', 'test_collections-1520', 'test_collections-1064', 'test_collections-1305', 'test_collections-1969', 'test_collections-1242', 'test_collections-663', 'test_collections-775', 'test_collections-1355', 'test_collections-752', 'test_collections-994', 'test_collections-615', 'test_collections-1461', 'test_collections-422'] SET rating='exceeded_expectation' RETURNING meta().id;
      5. SELECT  * from default:`9dGcEmYNseE6iW2A5Ea-4-854000`.`_default`.`_default` WHERE META().id in ['test_collections-226', 'test_collections-1082', 'test_collections-1677', 'test_collections-1626', 'test_collections-1602', 'test_collections-839', 'test_collections-917', 'test_collections-1520', 'test_collections-1064', 'test_collections-1305', 'test_collections-1969', 'test_collections-1242', 'test_collections-663', 'test_collections-775', 'test_collections-1355', 'test_collections-752', 'test_collections-994', 'test_collections-615', 'test_collections-1461', 'test_collections-422'];
      6. SAVEPOINT a1;
      7. INSERT INTO default:`9dGcEmYNseE6iW2A5Ea-4-854000`.`_default`.`_default` (KEY k1, value t) SELECT DISTINCT t.name AS k1,t FROM default:`9dGcEmYNseE6iW2A5Ea-4-854000`.`_default`.`_default` t WHERE  job_title='Pre-Sales' LIMIT 10 RETURNING *;
      8. SAVEPOINT a1; 
      9. UPDATE default:`9dGcEmYNseE6iW2A5Ea-4-854000`.`_default`.`_default` USE KEYS  ['test_collections-852', 'test_collections-27', 'test_collections-1264', 'test_collections-188', 'test_collections-1405', 'test_collections-1095', 'test_collections-268', 'test_collections-1390', 'test_collections-1206', 'test_collections-183', 'test_collections-172', 'test_collections-815', 'test_collections-1502', 'test_collections-1348', 'test_collections-1394', 'test_collections-420', 'test_collections-1299', 'test_collections-1225', 'test_collections-202', 'test_collections-875'] SET joined='towards_end' RETURNING meta().id;
      10. SELECT  * from default:`9dGcEmYNseE6iW2A5Ea-4-854000`.`_default`.`_default` WHERE META().id in ['test_collections-852', 'test_collections-27', 'test_collections-1264', 'test_collections-188', 'test_collections-1405', 'test_collections-1095', 'test_collections-268', 'test_collections-1390', 'test_collections-1206', 'test_collections-183', 'test_collections-172', 'test_collections-815', 'test_collections-1502', 'test_collections-1348', 'test_collections-1394', 'test_collections-420', 'test_collections-1299', 'test_collections-1225', 'test_collections-202', 'test_collections-875'];
      11.  SAVEPOINT a1;
      12.  SELECT * FROM system:transactions;
      13.  COMMIT WORK; 
      

      Statement 7 fails with "Duplicate Key" error(Insert statement). After commit, update done on statement 4 is not seen in the cluster.

      Ran the same on cbq and attached the output.

      Test case:
      guides/gradlew --refresh-dependencies testrunner -P jython=/opt/jython/bin/jython -P 'args=-i b/try.ini rerun=False,data_spec_name=initial_load_N1ql -t N1qlTransaction.basic_ops.BasicOps.test_with_use_keys,nodes_init=2,num_stmt_txn=10,num_savepoints=2,override_savepoint=3,GROUP=P0,bucket_spec=single_bucket.def_scope_ten_collections'

      I am not sure if statement failure is an issue or something to do with savepoints.

      Attachments

        For Gerrit Dashboard: MB-43524
        # Subject Branch Project Status CR V

        Activity

          People

            anitha.kuberan Anitha Kuberan
            anitha.kuberan Anitha Kuberan
            Votes:
            0 Vote for this issue
            Watchers:
            4 Start watching this issue

            Dates

              Created:
              Updated:
              Resolved:

              Gerrit Reviews

                There are no open Gerrit changes

                PagerDuty