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

Create a flag or mechanism for identifying pre-fetch thread sessions

    • Storage Engines
    • 3
    • 2024-02-06 tapioooooooooooooca

      WT-11850 implemented a solution for pre-fetching threads to skip certain visibility checks that are not required. It attempts to use the WT_SESSION_PREFETCH flag to check if a pre-fetching session is trying to read from a checkpoint file, however this is actually incorrect as sessions specifically created for pre-fetch threads are never configured with this flag.

                   *
                   * The visibility information is not referenced on the page so we need to ensure that
                   * the value is globally visible at the point in time where we read the page into cache.
                   * Pages from checkpoint-related files that have been pushed onto the pre-fetch queue
                   * will be comprised of data that is globally visible, and so the reader thread which
                   * attempts to read the page into cache can skip the visible all check.
                   */
                  if (!btree->huffman_value &&
                    !(WT_READING_CHECKPOINT(session) && F_ISSET(session, WT_SESSION_PREFETCH)) &&
      

      This is where the pre-fetch threads are configured - it will never be configured with WT_SESSION_PREFETCH enabled.

          session_flags = WT_THREAD_CAN_WAIT | WT_THREAD_PANIC_FAIL;
          WT_RET(__wt_thread_group_create(session, &conn->prefetch_threads, "prefetch-server", 8, 8,
            session_flags, __wt_prefetch_thread_chk, __wt_prefetch_thread_run, NULL));
      

      Rather than checking the WT_SESSION_PREFETCH flag, we should either introduce a new flag in the session structure and check that, or implement some other kind of mechanism.

            Assignee:
            clarisse.cheah@mongodb.com Clarisse Cheah
            Reporter:
            monica.ng@mongodb.com Monica Ng
            Votes:
            0 Vote for this issue
            Watchers:
            2 Start watching this issue

              Created:
              Updated:
              Resolved: