Progress counters in RTS incorrectly include history store and metadata files

XMLWordPrintableJSON

    • Type: Bug
    • Resolution: Fixed
    • Priority: Major - P3
    • WT12.0.0, 9.0.0-rc0
    • Affects Version/s: None
    • Component/s: RTS
    • None
    • Storage Engines, Storage Engines - Persistence
    • 0.008
    • SE Persistence backlog
    • None

      Issue Summary

      The progress counters max_count and rollback_count in

      rts.c

      are inflated because they include files with URIs matching WT_BTREE_PREFIX(uri), which also matches history store (e.g., file:WiredTigerHS.wt, file:WiredTigerSharedHS.wt_stable) and metadata files (e.g., file:WiredTiger.wt, file:WiredTigerShared.wt_stable). These files are subsequently filtered out in __wti_rts_btree_walk_btree_apply, but the counters are still incremented, resulting in progress messages reporting incorrect totals. There is no correctness impact on RTS itself.

      Context

      • The issue occurs in
        src/rollback_to_stable/rts.c

        .

      • The current logic increments the counters for any URI matching WT_BTREE_PREFIX, including history store and metadata files.
      • These files are then ignored by the inner logic in
        rts_btree_walk.c

        :

        if (!WT_BTREE_PREFIX(uri) || WT_IS_URI_HS(uri) || WT_IS_URI_METADATA(uri))
            return (0);
        
      • As a result, progress messages from __wti_rts_progress_msg are misleading.

      Proposed Solution

      Apply the same guards in the counter logic in

      rts.c

      so only files actually processed by RTS are counted:

      if (WT_BTREE_PREFIX(uri) && !WT_IS_URI_HS(uri) && !WT_IS_URI_METADATA(uri))
          ++max_count;   /* first pass */
      
      if (WT_BTREE_PREFIX(uri) && !WT_IS_URI_HS(uri) && !WT_IS_URI_METADATA(uri))
          ++rollback_count;  /* second pass */
      

      This will ensure the progress counters accurately reflect the number of files processed, aligning with the filtering in __wti_rts_btree_walk_btree_apply.


      Original Slack thread: https://mongodb.slack.com/archives/C0AKD3HPD8T/p1776380188507509
      This ticket was generated by AI from a Slack thread.

            Assignee:
            Yury Ershov
            Reporter:
            Memento Slack Bot
            Votes:
            0 Vote for this issue
            Watchers:
            2 Start watching this issue

              Created:
              Updated:
              Resolved: