Move opCtx-coupled IncrementalFeatureRolloutContext code out of server_base to fix UBSan link failure

XMLWordPrintableJSON

    • Type: Bug
    • Resolution: Fixed
    • Priority: Major - P3
    • 9.1.0-rc0, 9.0.0-rc1
    • Affects Version/s: None
    • Component/s: None
    • None
    • Query Integration
    • Fully Compatible
    • ALL
    • v9.0
    • 200
    • None
    • None
    • None
    • None
    • None
    • None
    • None

      SERVER-131199 added an opCtx->getClient()->isInDirectClient() call to IncrementalFeatureRolloutContext::get() in feature_flag.cpp, which is part of the server_base library. The calls are inline so normal builds are unaffected, but UBSan's vptr sanitizer emits references to typeinfo for mongo::Client and typeinfo for mongo::OperationContext, which are defined only in service_context. Binaries that link server_base without service_context (e.g. ksdecode_with_debug) fail to link on the UBSan all-feature-flags variants, breaking archive_dist_test on master since 2a98177057 (BF-44767).

      Fix: move the opCtx-coupled statics (get/tryGet/isInstalled/set/installForRequestWithoutIfrFlags and the opCtx decoration) into a new ifr_context_decoration.cpp in the service_context target, mirroring the existing version_context_decoration.cpp split. No behavior change.

            Assignee:
            Will Buerger
            Reporter:
            Will Buerger
            Votes:
            0 Vote for this issue
            Watchers:
            2 Start watching this issue

              Created:
              Updated:
              Resolved: