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

Inconsistent values for $$NOW across shards in find queries

    • Type: Icon: Bug Bug
    • Resolution: Fixed
    • Priority: Icon: Major - P3 Major - P3
    • 8.1.0-rc0, 8.0.0-rc3
    • Affects Version/s: None
    • Component/s: None
    • Labels:
      None
    • Query Optimization
    • Fully Compatible
    • ALL
    • v8.0, v7.3, v7.0, v6.0, v5.0
    • QO 2024-03-04, QO 2024-03-18, QO 2024-04-01, QO 2024-04-15, QO 2024-04-29

      For aggregations, we compute runtime constant system variables ($$NOW, $$CLUSTER_TIME) once on mongos and set them via let variables in the command set to all shards. This ensures that all shards use the same value for the duration of the query. It appears that we are not doing this for find queries, see repro here: now-repro.js.

      The $$NOW variable can be referenced in a find are in filter using $expr or a computed projection.

            Assignee:
            peter.volk@mongodb.com Peter Volk
            Reporter:
            ben.shteinfeld@mongodb.com Ben Shteinfeld
            Votes:
            0 Vote for this issue
            Watchers:
            8 Start watching this issue

              Created:
              Updated:
              Resolved: