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

Concurrency workloads using transactions should use autoRetry for reads and writes

    • Fully Compatible
    • ALL
    • v4.0
    • TIG 2018-06-18

      The Concurrency workloads which test transactions, should use an auto retry for both reads and writes:

      • jstests/concurrency/fsm_workloads/multi_statement_transaction_atomicity_isolation.js
      • jstests/concurrency/fsm_workloads/multi_statement_transaction_simple.js

      The current function withTxnAndAutoRetryOnWriteConflict should be renamed to withTxnAndAutoRetry and only handle Transiet errors:

                  try {
                      func();
      
                      // commitTransaction() calls assert.commandWorked(), which may fail with a
                      // WriteConflict error response. We therefore suppress its doassert() output.
                      quietly(() => session.commitTransaction());
                  } catch (e) {
                      if (!e.hasOwnProperty('errorLabels') ||
                          !e.errorLabels.includes('TransientTransactionError')) {
                          throw e;
                      }
                  ...
                  }
      

            Assignee:
            jonathan.abrahams Jonathan Abrahams
            Reporter:
            jonathan.abrahams Jonathan Abrahams
            Votes:
            0 Vote for this issue
            Watchers:
            3 Start watching this issue

              Created:
              Updated:
              Resolved: