Uploaded image for project: 'Core Server'
  1. Core Server
  2. SERVER-43148

third_party/murmurhash layering violation

    • Type: Icon: Bug Bug
    • Resolution: Fixed
    • Priority: Icon: Major - P3 Major - P3
    • 4.3.1
    • Affects Version/s: None
    • Component/s: Internal Code
    • Labels:
      None
    • Fully Compatible
    • Dev Tools 2019-09-23, Dev Tools 2019-10-07

      third_party/murmurhash includes mongo/base and mongo/platform headers unnecessarily. It's doing this to access ConstDataView to get an unaligned endian swap.
      Unfortunately that brings in a lot of mongo-specifics that can end up bringing in Abseil, and murmurhash isn't built with Abseil in its #include path.

      So we're left with unwritten rules about which headers base and ConstDataView can include, or we can fix the layering violation in MurmurHash. I think we should inline the unaligned load and endian-swapping code into murmurhash since that's a pretty standard operation, and it's strange for a third_party library to reach out to mongo for support headers anyway.

      I found this by adding stdx/unordered_map to base/init.h and getting a compile failure in murmurhash.

            Assignee:
            billy.donahue@mongodb.com Billy Donahue
            Reporter:
            billy.donahue@mongodb.com Billy Donahue
            Votes:
            0 Vote for this issue
            Watchers:
            2 Start watching this issue

              Created:
              Updated:
              Resolved: