Reset disagg block cache parameter globals in PaliCallbacksTest::tearDown to prevent test state leakage

XMLWordPrintableJSON

    • Type: Task
    • Resolution: Duplicate
    • Priority: Major - P3
    • None
    • Affects Version/s: None
    • Component/s: None
    • None
    • Storage Engines - Persistence
    • None
    • None
    • None
    • None
    • None
    • None
    • None

      Reset the process-global disaggregated block cache parameters in
      `PaliCallbacksTest::tearDown()` so their values do not leak across tests in the
      `pali_test` binary.

          1. Changes
      • In `src/mongo/db/modules/atlas/src/disagg_storage/pali/block_cache/pali_test.cpp`,
        `PaliCallbacksTest::tearDown()` now resets `gBlockCacheSizeBytes` and
        `gBlockCacheNumShards` to `0` before calling `ServiceContextMongoDTest::tearDown()`.
          1. Why
            The fixture tests `GetFullPageFromCache`, `GetDeltaPageFromCache`, and
            `GetMultiplePagesFromCache` set these server parameters (declared in
            `disagg_storage/server_parameters.idl`) but never restored them. Because they are
            process globals, the values persisted for the rest of the test binary. No current
            test depends on the default (`0`), so this has not caused a failure, but the
            unittest runner can randomize test order, making it a latent state leak. Resetting
            once in `tearDown()` covers all current and future fixture-based tests uniformly.

            Assignee:
            Etienne Petrel
            Reporter:
            Etienne Petrel
            Votes:
            0 Vote for this issue
            Watchers:
            1 Start watching this issue

              Created:
              Updated:
              Resolved: