Uploaded image for project: 'WiredTiger'
  1. WiredTiger
  2. WT-8207

Add assert for excessive amounts of rollbacks in CPP framework

    XMLWordPrintable

    Details

    • Type: Improvement
    • Status: Open
    • Priority: Major - P3
    • Resolution: Unresolved
    • Affects Version/s: None
    • Fix Version/s: Backlog
    • Component/s: None
    • Labels:
      None

      Description

      Inside the cppsuite framework, there are numerous ways where we can rollback the current active transaction. The functions can_commit, insert or update checks if the current test needs to rollback. If so, we return back false, and the test needs to perform a rollback. The function commit performs WiredTiger's commit_transaction(), if the function call fails, internally WT performs a rollback.

      It is possible that a particular test can be stuck when rollbacks are continuously called. Currently there is some functionality inside CPP tests, where we check if there is a large amount of continous rollbacks in hs_cleanup.cxx.

                  if (tc->update(cursor, coll.id, key_value_t(key_tmp))) {
                      if (tc->transaction.can_commit()) {
                          if (tc->transaction.commit())
                              rollback_retries = 0;
                          else
                              ++rollback_retries;
                      }
                  } else {
                      tc->transaction.rollback();
                      ++rollback_retries;
                  }
                  testutil_assert(rollback_retries < MAX_ROLLBACKS);
      

      This ticket aims to provide a better method of asserting when a test continuously perform transaction rollbacks. This can be done by moving the above functionality and assert inside the CPP framework (most likely thread_context.cxx). The idea is to have an internal counter which tracks the number of rollbacks and add the assert in can_commit, insert, update, or commit.

        Attachments

          Activity

            People

            Assignee:
            backlog-server-storage-engines Backlog - Storage Engines Team
            Reporter:
            jie.chen Jie Chen
            Votes:
            0 Vote for this issue
            Watchers:
            3 Start watching this issue

              Dates

              Created:
              Updated: