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

Reduce collStats logging for unexpected fields

    • Type: Icon: Bug Bug
    • Resolution: Won't Do
    • Priority: Icon: Major - P3 Major - P3
    • None
    • Affects Version/s: None
    • Component/s: None
    • Sharding EMEA
    • ALL
    • Sharding EMEA 2023-01-23, Sharding EMEA 2023-02-06, Sharding EMEA 2023-02-20, Sharding EMEA 2023-03-06

      Currently the mongos when executes collStats, parse and aggregate the replies from all the shards and emits a log line every time it encounters a field not mentioned in the aggregation loop.
      Emitting a log line is not useful at all and cause more harm than good:

      • It doesn't help developers remembering to update the mongos aggregation loop when they add a new metric to collStats. If all tests pass then developers will simply commit their new code.
      • For customer with production cluster is completely useless to know that we forgot to update the metrics aggregation loop on the mongos.

      Either we decide to make this check more strict (invariant/tassert) and force developers to always update the metrics aggregation loop on the mongos or we keep the current semantics but we log only at debug level so that it won't be visible in production.

      Also if we decide to keep the log, we should emit a single log line with a list of missing fields and not one line per fields.

      Currently (r6.3.0-alpha-1041-g541ba52e793 this is the list of missing fields:

      numOrphanDocs
      freeStorageSize
      inMemory
      indexBuilds
      scaleFactor
      $clusterTime
      $configTime
      $topologyTime
      operationTime
      

       

            Assignee:
            pol.pinol@mongodb.com Pol Pinol
            Reporter:
            tommaso.tocci@mongodb.com Tommaso Tocci
            Votes:
            1 Vote for this issue
            Watchers:
            5 Start watching this issue

              Created:
              Updated:
              Resolved: