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

[test-only bug] Compare number of chunks in balancing_based_on_size.js

    • Type: Icon: Bug Bug
    • Resolution: Fixed
    • Priority: Icon: Major - P3 Major - P3
    • 6.0.3, 6.1.0-rc0
    • Affects Version/s: None
    • Component/s: None
    • None
    • Fully Compatible
    • ALL
    • v6.0
    • Sharding EMEA 2022-06-13
    • 21

      Change this data size comparison with a comparison on number of chunks: this is equivalent because that part of the test simply needs to verify that no move has happened due to expected no-op balancing rounds.

      Long explanation (from a build failure)

      When a range deletion happens:
      1. The documents in range are deleted.
      2. The counter of orphans is updated, triggering also an update of the orphans counter on the BalancerStatsRegistry.

      Note that points 1-2 are not happening in the same storage transaction, and - even if they would - the update of the in-memory stats registry would still not happen atomically.

      The test uses the get stats for balancing command that - when invoked for a namespace:
      A. Retrieves the total data size for the collection from the storage stats.
      B. Retrieves the number of orphans for the collection from the BalancerStatsRegistry.

      The test is doing the following:

      According to the failure, the actual data size on the donor was 6 before the no-op rounds and became 7 after the no-op rounds. However, no move has happened and the rounds really resulted in no-ops.

      The only viable explanation is that the following flow interleaving happened: 1 - A - 2 - B. Basically the balancer stats registry retrieved the data size after an orphaned document was deleted but before the number of orphans was updated. This resulted in an off-by-one.

            Assignee:
            pierlauro.sciarelli@mongodb.com Pierlauro Sciarelli
            Reporter:
            pierlauro.sciarelli@mongodb.com Pierlauro Sciarelli
            Votes:
            0 Vote for this issue
            Watchers:
            2 Start watching this issue

              Created:
              Updated:
              Resolved: