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

Encode flag indicating whether all data is present on a single shard into the SBE plan cache key

    XMLWordPrintableJSON

Details

    • Icon: Task Task
    • Resolution: Won't Do
    • Icon: Major - P3 Major - P3
    • None
    • None
    • None
    • None
    • Query Optimization

    Description

      For queries against unsharded collections, the query system currently generates plans which do not perform orphan filtering. Such plans can then get cached in the SBE plan cache. If the collection later becomes sharded, then cached plans which do not perform shard filtering are no longer valid. In order to prevent invalid cached plans from being reused when a collection becomes sharded, we currently encode the collection's sharding epoch into the SBE plan cache key.

      This depends on the collection's sharding epoch changing when a collection transitions from unsharded to sharded. The problem is that the sharding team is working on eliminating the concept of unsharded collections and may alter the semantics of the sharding epoch so that it no longer gets bumped when a collection is first sharded. In order to prepare for this change, we should explicitly encode whether or not the collection is sharded into the SBE plan cache key. That way the sharding team will not unwittingly break the SBE plan cache with a subtle change to unrelated logic around the collection sharding epoch.

      Attachments

        Activity

          People

            backlog-query-optimization Backlog - Query Optimization
            david.storch@mongodb.com David Storch
            Votes:
            0 Vote for this issue
            Watchers:
            5 Start watching this issue

            Dates

              Created:
              Updated:
              Resolved: