ExportXMLWordPrintableJSON

    • Type: Task
    • Resolution: Fixed
    • Priority: Major - P3
    • 9.1.0-rc0, 9.1.0-rc1024
    • Affects Version/s: None
    • Component/s: None
    • None
    • Fully Compatible
    • Build OnDeck
    • None
    • None
    • None
    • None
    • None
    • None
    • None

      Windows cross-built unit tests failed with `ObjectAlreadyExists` while registering change-stream metrics. Statically linked tests include mongod and mongos registration sites reading shared `inline` options. The cross compiler emitted constructors in an order that allowed registration to read those options before initialization, omitting serverStatus paths and creating conflicting metric definitions. The C++ definitions should satisfy partially ordered initialization.

      LLVM #229174(https://github.com/llvm/llvm-project/pull/229174) addresses the COFF section-ordering bug demonstrated by the [reproducer](https://godbolt.org/z/a1ojWahvE). Applying it locally restores options-before-registration ordering in a linked two-translation-unit reduction with either object link order, using unchanged lld-link 19.1.7.

      This workaround constructs options inside the existing `createCurorsTotalOpened`, `createCursorsLifespan`, `createCursorsOpenTotal`, and `createCursorsOpenPinned` factories. It preserves namespace-scope metric registration, stored cursor references, histogram configuration, and registration before the serverStatus trees freeze. No MongoDB initializer changes are needed.

      Regression tests check startup serverStatus paths on shard and router cursor binaries, repeated factory calls against statically registered definitions, and cursor-option histogram recording, including when OTel is disabled on Windows.

      Extracted from 63670(https://github.com/10gen/mongo/pull/63670). This workaround remains useful until the upstream fix reaches the toolchain.

      Validation: all seven cursor-option metric tests passed on macOS; formatting and diff checks passed.

            Assignee:
            Daniel Moody
            Reporter:
            Daniel Moody
            Votes:
            0 Vote for this issue
            Watchers:
            2 Start watching this issue

              Created:
              Updated:
              Resolved: