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

Fixing invariants on ShardServerCatalogCacheLoader to consider different terms

    XMLWordPrintable

    Details

    • Backwards Compatibility:
      Fully Compatible
    • Operating System:
      ALL
    • Backport Requested:
      v5.0, v4.4, v4.2, v4.0
    • Sprint:
      Sharding EMEA 2021-05-31

      Description

      These two invariants of the ShardServerCatalogCacheLoader verify that the ChunkVersions of the last task is contiguous to the ChunkVersions of the new task. However these invariants are incomplete: they do not properly cover scenarios in which there are stepdowns/stepups.

      Note that when a new node is elected as primary it bumps its term. This is important because it changes how the minQueryVersion is computed: instead of looking at the in-memory list of tasks associated with the previous term (i.e., last time this node was primary) we end up taking as minQueryVersion whatever version is persisted on config.cache.chunks. However, when we add this new task to the list, the implementation does not consider the terms and ends up comparing versions that are not contiguous: the maxQueryVersion of the last task is different than the minQueryVersion of the new task.

      The proposed solution is to avoid comparing tasks of different terms.

        Attachments

          Activity

            People

            Assignee:
            antonio.fuschetto Antonio Fuschetto
            Reporter:
            antonio.fuschetto Antonio Fuschetto
            Participants:
            Votes:
            0 Vote for this issue
            Watchers:
            5 Start watching this issue

              Dates

              Created:
              Updated:
              Resolved: