Uploaded image for project: 'Couchbase node.js Client Library'
  1. Couchbase node.js Client Library
  2. JSCBC-981

readYourOwnWrites in transaction context seems to fail

    XMLWordPrintable

Details

    • Bug
    • Resolution: Fixed
    • Critical
    • 4.0.0
    • None
    • library
    • None
    • 1

    Description

      After a flush, I will get a document not found when doing a get after an insert in a transaction context.

      async function getReadOwnWrites() {
        let cluster = await getCluster()
        let collection = await getCollection()
        // tag::getReadOwnWrites[]
        cluster.transactions().run(async ctx => {
          const docId = "docId"
       
          ctx.insert(collection, docId, {})
       
          // TODO: seems to fail/be a bug?
          const doc = await ctx.get(collection, docId)
        })
        // end::getReadOwnWrites[]
      }
      

      Logging says

      [2022-01-29 21:26:16.015] [15388,20311165] [info] 0ms, 0x7fcdbad1e2b0 3 active clients (including this one), 1024 atrs to check 351906us delay between checking each atr
      /Users/ingenthr/src/couchnode/dist/bindingutilities.js:446
              return new errs.TransactionOperationFailedError(txnExternalExeptionFromCpp(err.cause));
                     ^
      TransactionOperationFailedError: transaction operation failed
          at Object.errorFromCpp (/Users/ingenthr/src/couchnode/dist/bindingutilities.js:446:16)
          at /Users/ingenthr/src/couchnode/dist/transactions.js:140:48 {
        cause: 'document_not_found_exception'
      }
      

      Attachments

        Issue Links

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

          Activity

            People

              brett19 Brett Lawson
              ingenthr Matt Ingenthron
              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