Make a helper function to compute atClusterTime for a set of shards

XMLWordPrintableJSON

    • Type: Task
    • Resolution: Duplicate
    • Priority: Major - P3
    • None
    • Affects Version/s: None
    • Component/s: Sharding
    • None
    • Sharding 2018-04-09
    • None
    • 3
    • None
    • None
    • None
    • None
    • None
    • None

      This logic is implemented in several places of cluster_find and cluster_aggregate

          if (isSnapshotRead) {
              std::set<ShardId> shardIds = {shardId};
              atClusterTime = computeAtClusterTime(opCtx, shardIds);
              bool isSameShardIds = verifyTargetedShardsAtClusterTime(opCtx, shardIds, atClusterTime);
              if (!isSameShardIds) {  // use the current clusterTime if chunks moved
                  atClusterTime = LogicalClock::get(opCtx)->getClusterTime();
              }
          }
      

      Build a helper to keep it in one place.

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

              Created:
              Updated:
              Resolved: