ExportXMLWordPrintableJSON

    • Type: Bug
    • Resolution: Unresolved
    • Priority: Major - P3
    • None
    • Affects Version/s: None
    • Component/s: Cache and Eviction
    • None
    • Storage Engines, Storage Engines - Transactions
    • 0.005
    • SE Transactions - 2027-01-01
    • None

      Summary

      A cursor operation on a session with no explicit transaction and no modifications can wait in application eviction indefinitely when the dirty cache is above its trigger and the stable timestamp is held back by other threads. Nothing bounds or interrupts that wait.

      Conditions

      • The session has no explicit transaction, no modifications, and no operation timer (the operation timeout is only configurable through begin_transaction).
      • cache_max_wait_ms is at its default of 0, which means wait forever.
      • The dirty cache is above eviction_dirty_trigger and cannot be cleaned because the stable timestamp is not advancing, so the wait never ends by itself.
      • The caller does not register a WT_EVENT_EVICTION handle_general callback, so the interruptible path does not exit.

      Why existing exits do not apply

      • The cursor enter path calls the application eviction check with busy=false, readonly=false, interruptible=true, bounded=false. The bounded wait cap (WTI_EVICT_BOUNDED_WAIT_US, 60s) is only requested at transaction commit and rollback, not on this path.
      • The transaction-is-blocking check returns 0 for a session with no modifications that is not running a transaction, so the thread is never rolled back. Writers escape this way because they have a transaction, modifications and an operation timer.

      Where it was observed

      test/format (disagg switch, truncate enabled, format-stress-test-disagg-switch) fails with "format run more than 15 minutes past the maximum time". The stalled threads are in the post-truncate mirror verification, which walks cursors on a session with no transaction. Two core dumps and BFG stacks show these threads in the application eviction wait inside the cursor enter path. Their commit timestamps stop advancing, which pins the stable timestamp and keeps dirty content from being evicted, so the wait never ends and other threads join it.

      Reproduction

      A Python test using a layered table in a disaggregated leader, a 50MB cache, a stable timestamp pinned at 1, and enough newer updates to exceed the dirty trigger. A reader thread that only iterates a cursor (no transaction) makes no progress for more than 20 seconds with 0 rows read. The same reader with ignore_cache_size=true on its session completes. A reader inside an explicit transaction is rolled back by the transaction-is-blocking check in some runs, and in other runs completes. The stalled thread stack is: cursor next, clayered iterate, clayered enter, cursor enter, application eviction check, application eviction worker, condition wait (10ms).

      Expected

      A read-only caller with no transaction state should not wait in application eviction without a bound.

      Possible directions (to be evaluated)

      • Pass bounded=true from the cursor enter path when the session has no transaction state, reusing the existing bounded wait. The existing assertion in the check requires the session to have no modifications for a bounded caller.
      • Apply a default cache wait limit when no operation timeout is configured.

      Related

      The test/format failure is addressed in the test program: a thread that runs the mirror verification no longer holds back the stable timestamp while it verifies, so stable can advance and the dirty cache can drain. This ticket covers the engine side, where such a wait has no bound.

            Assignee:
            [DO NOT USE] Backlog - Storage Engines Team
            Reporter:
            Shoufu Du
            Votes:
            0 Vote for this issue
            Watchers:
            1 Start watching this issue

              Created:
              Updated: