Uploaded image for project: 'Core Server'
  1. Core Server
  2. SERVER-59657

Add ErrorExtraInfo for the WriteConflictException and use in transaction_participant.cpp updateSessionEntry()

    • Fully Compatible
    • Sharding 2021-11-01, Sharding 2021-11-15, Sharding 2021-11-29
    • 19

      The WriteConflict error is not informative.

      In particular, preparing transactions in the test while refreshing sessions with logical_session_cache_replication_1sec_refresh_jscore_passthrough throws an exception:

      assert: command failed: {
      [js_test:commit_prepared_transaction_errors] 	"errorLabels" : [
      [js_test:commit_prepared_transaction_errors] 		"TransientTransactionError"
      [js_test:commit_prepared_transaction_errors] 	],
      [js_test:commit_prepared_transaction_errors] 	"ok" : 0,
      [js_test:commit_prepared_transaction_errors] 	"errmsg" : "WriteConflict error: this operation conflicted with another operation. Please retry your operation or multi-document transaction.",
      [js_test:commit_prepared_transaction_errors] 	"code" : 112,
      [js_test:commit_prepared_transaction_errors] 	"codeName" : "WriteConflict",
      [js_test:commit_prepared_transaction_errors] 	"$clusterTime" : {
      [js_test:commit_prepared_transaction_errors] 		"clusterTime" : Timestamp(1623840426, 4),
      [js_test:commit_prepared_transaction_errors] 		"signature" : {
      [js_test:commit_prepared_transaction_errors] 			"hash" : BinData(0,"AAAAAAAAAAAAAAAAAAAAAAAAAAA="),
      [js_test:commit_prepared_transaction_errors] 			"keyId" : NumberLong(0)
      [js_test:commit_prepared_transaction_errors] 		}
      [js_test:commit_prepared_transaction_errors] 	},
      [js_test:commit_prepared_transaction_errors] 	"operationTime" : Timestamp(1623840426, 4)
      [js_test:commit_prepared_transaction_errors] }
      

      was this code thrown from the updateSessionEntry() and if yes, why?

      Design WriteConflictExceptionExtraInfo to find out.

            Assignee:
            andrew.shuvalov@mongodb.com Andrew Shuvalov (Inactive)
            Reporter:
            andrew.shuvalov@mongodb.com Andrew Shuvalov (Inactive)
            Votes:
            0 Vote for this issue
            Watchers:
            2 Start watching this issue

              Created:
              Updated:
              Resolved: