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

Increment collection major version on chunk splits/merges

    • Type: Icon: Bug Bug
    • Resolution: Fixed
    • Priority: Icon: Major - P3 Major - P3
    • 3.6.15, 4.0.13, 4.3.1, 4.2.2
    • Affects Version/s: None
    • Component/s: Sharding
    • None
    • Fully Compatible
    • ALL
    • v4.2, v4.0, v3.6
    • Sharding 2019-07-01, Sharding 2019-07-15, Sharding 2019-07-29

      On 3.6 and 4.0, we only increment the collection minor version when a chunk is split or merged. The original reasoning for this was to prevent unnecessary routing table refreshes on the routers, which don't ordinarily need to know about chunk splits (since they don't change targeting information).

      However, when a chunk split operation fails in 3.6, we refresh the routing table on the shard. When the routing table is refreshed, any shard whose shard version is less than the collection version will then have its shard version bumped. This means that on all but one shard (the shard whose shard version is equal to the collection version), this means that subsequent requests to that shard will trigger a refresh on the router anyways.

      In other words, only incrementing the minor version was not achieving its goal anyways, so it's safe to increment the major version instead.

      In the case of autosplitting triggered by routers, this is important in the case where the shard being targeted for a split is also the shard whose shard version is equal to the collection version, because a failed chunk split will not cause routers to refresh, and they will simply continue trying to split the same chunk over and over again until something else causes them to refresh.

            Assignee:
            matthew.saltz@mongodb.com Matthew Saltz (Inactive)
            Reporter:
            matthew.saltz@mongodb.com Matthew Saltz (Inactive)
            Votes:
            0 Vote for this issue
            Watchers:
            9 Start watching this issue

              Created:
              Updated:
              Resolved: