Determine whether we need const CollectionShardingState/DatabaseShardingState instances for Lock-Free Reads

XMLWordPrintableJSON

    • Type: Task
    • Resolution: Done
    • Priority: Major - P3
    • None
    • Affects Version/s: None
    • Component/s: Storage
    • None
    • Execution Team 2020-12-28, Execution Team 2021-01-11, Execution Team 2021-01-25, Execution Team 2021-02-08, Execution Team 2021-02-22
    • None
    • 3
    • None
    • None
    • None
    • None
    • None
    • None
    • None

      Currently we're adding shared_ptr getters to the interfaces in SERVER-51319.

      Ideally, CSS::getShared, etc., would return const pointers, but would require further interface changes to accept const pointers. Also, without const pointers, or more accurately without copy-on-write, the metadata instance fetched can be modified during a read. (internally, Collection/DatabaseShardingState have concurrency control via mutex, but state still changes??)

      Maybe this is safe, but need to double check, particularly with things like the resharding project coming up?

              Assignee:
              Dianna Hohensee (Inactive)
              Reporter:
              Dianna Hohensee (Inactive)
              Votes:
              0 Vote for this issue
              Watchers:
              2 Start watching this issue

                Created:
                Updated:
                Resolved: