Fix test jstests/core/query/nin/nin2.js to work with balancer

XMLWordPrintableJSON

    • Type: Bug
    • Resolution: Fixed
    • Priority: Major - P3
    • 8.3.0-rc0
    • Affects Version/s: None
    • Component/s: Query Execution
    • None
    • Query Execution
    • Fully Compatible
    • ALL
    • QE 2025-10-13
    • 0
    • None
    • None
    • None
    • None
    • None
    • None
    • None

      BF-39882 is about a test failure in jstests/core/query/nin/nin2.js.
      The test failure happens non-deterministically in the task multi_stmt_txn_jscore_passthrough_with_migration that moves chunks around using the balancer.
      The root cause of the test failure is that the test uses count(expr) and not countDocuments(expr).

      According to our documentation count(expr) does not take orphans into account:

      Unlike db.collection.count(), db.collection.countDocuments() does not use the metadata to return the count. Instead, it performs an aggregation of the document to return an accurate count, even after an unclean shutdown or in the presence of orphaned documents in a sharded cluster.

      The test should be adjusted to use countDocument(expr) instead of count(expr).

            Assignee:
            Jan Steemann
            Reporter:
            Jan Steemann
            Votes:
            0 Vote for this issue
            Watchers:
            2 Start watching this issue

              Created:
              Updated:
              Resolved: