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

Don't rollback resolve-search in case of being the oldest transaction pinning cache

    • Type: Icon: Improvement Improvement
    • Resolution: Unresolved
    • Priority: Icon: Major - P3 Major - P3
    • None
    • Affects Version/s: None
    • Component/s: None
    • Labels:
      None

      __wt_txn_is_blocking can roll back a transaction if it is the oldest running and holding back eviction. The search operation for slow path update resolution can hence be rolled back if this were to happen. This should not be allowed as we resolve at the time of commit/rollback, which would eventually lead to unpinning the transaction. Also, the resolution should just not fail - we are past the point of no return in commit/rollback.

      We have already made sure we do not roll back prepared transactions. We will have to also make sure we do not roll back the search we are doing as part of resolving updates.

      /*
       * __wt_txn_is_blocking --
       *     Return an error if this transaction is likely blocking eviction because of a pinned
       *     transaction ID, called by eviction to determine if a worker thread should be released from
       *     eviction.
       */
      int
      __wt_txn_is_blocking(WT_SESSION_IMPL *session)
      {
          ...
          /* We can't roll back prepared transactions. */
          if (F_ISSET(txn, WT_TXN_PREPARE))
              return (0);
      
          /*
           * MongoDB can't (yet) handle rolling back read only transactions. For this reason, don't check
           * unless there's at least one update or we're configured to time out thread operations (a way
           * to confirm our caller is prepared for rollback).
           */
          if (txn->mod_count == 0 && !__wt_op_timer_fired(session))
              return (0);
      
          /*
           * Check if either the transaction's ID or its pinned ID is equal to the oldest transaction ID.
           */
          return (txn_shared->id == global_oldest || txn_shared->pinned_id == global_oldest ?
              __wt_txn_rollback_required(
                session, "oldest pinned transaction ID rolled back for eviction") :
              0);
      }
      

            Assignee:
            backlog-server-storage-engines [DO NOT USE] Backlog - Storage Engines Team
            Reporter:
            sulabh.mahajan@mongodb.com Sulabh Mahajan
            Votes:
            0 Vote for this issue
            Watchers:
            1 Start watching this issue

              Created:
              Updated: