Avoid duplicate checks on std::variant in oplog entry serialization/parsing

XMLWordPrintableJSON

    • Type: Improvement
    • Resolution: Duplicate
    • Priority: Major - P3
    • None
    • Affects Version/s: None
    • Component/s: None
    • None
    • Storage Execution
    • Storage Execution 2026-07-20
    • None
    • None
    • None
    • None
    • None
    • None
    • None

      `std::get<T>(std::variant<U, V>&& x)` checks the underlying type and throws std::bad_varaint_access when it fails.  This is caught at a high level and triggers std::terminate.  It would be better for the oplog parsing code to check once.  This can be achieved with *assert macros and std::get_if.  

            Assignee:
            Benjamin Pearce
            Reporter:
            Benjamin Pearce
            Votes:
            0 Vote for this issue
            Watchers:
            2 Start watching this issue

              Created:
              Updated:
              Resolved: