Avoid implicit conversion to long long in Counter64 and Atomic64Metric classes

XMLWordPrintableJSON

    • Type: Improvement
    • Resolution: Fixed
    • Priority: Major - P3
    • 8.0.0-rc0
    • Affects Version/s: None
    • Component/s: None
    • None
    • Service Arch
    • Fully Compatible
    • Service Arch 2024-02-19
    • None
    • 3
    • None
    • None
    • None
    • None
    • None
    • None

      Counter64 and Atomic64Metric have an implicit conversion to long long which is risky. It may be preferred to have a more conventional extension mechanism for custom metrics specifically.

      With the way they are currently defined we can place Counter64 and Atomic64Metric in any BSON object and they're also usable in any function that accepts a long long, which feels very loose and not quite what we intend to allow by making these definitions.

      This came up while reviewing PR 9902 (of SERVER-72815).

            Assignee:
            Billy Donahue
            Reporter:
            Adi Zaimi
            Votes:
            0 Vote for this issue
            Watchers:
            2 Start watching this issue

              Created:
              Updated:
              Resolved: