Convert invariants to tassert in Balancer code

XMLWordPrintableJSON

    • Type: Improvement
    • Resolution: Fixed
    • Priority: Major - P3
    • 8.0.0-rc0
    • Affects Version/s: None
    • Component/s: None
    • Catalog and Routing
    • Fully Compatible
    • CAR Team 2024-02-05, CAR Team 2024-02-19, CAR Team 2024-03-04
    • 2
    • None
    • 3
    • None
    • None
    • None
    • None
    • None
    • None

      A very rough check reveals that we currently have 45 invariants in balancer code:

      $ git grep "invariant(.\+)" src/mongo/db/s/balancer/ | wc -l
      
      45

       

      As much as possible, we should avoid using invariant and use tasserts instead. This will ensure that we only fail the balancer and restart it, instead of crashing the entire shard primary.

            Assignee:
            Wolfee Farkas
            Reporter:
            Tommaso Tocci
            Votes:
            0 Vote for this issue
            Watchers:
            3 Start watching this issue

              Created:
              Updated:
              Resolved: