Uploaded image for project: 'Solr'
  1. Solr
  2. SOLR-13685

Update the leader term in ZK on the condition that the replica is still the leader

Agile BoardAttach filesAttach ScreenshotAdd voteVotersWatch issueWatchersCreate sub-taskLinkCloneUpdate Comment AuthorReplace String in CommentUpdate Comment VisibilityDelete Comments
    XMLWordPrintableJSON

Details

    • Improvement
    • Status: Open
    • Major
    • Resolution: Unresolved
    • None
    • None
    • SolrCloud
    • None

    Description

      While working on SOLR-13141, I realized that the ZkShardTerms.ensureTermIsHigher and related methods do a compare-and-set on the terms but there is no guarantee that the leader is still the leader when the zk update executes. This can potentially lead to race conditions during leader transitions.

      We should update the term using a zk multi-op conditional on the current replica still being the leader. This will not change any behavior but will only be an additional safety check.

      Attachments

        Activity

          This comment will be Viewable by All Users Viewable by All Users
          Cancel

          People

            Unassigned Unassigned
            shalin Shalin Shekhar Mangar

            Dates

              Created:
              Updated:

              Slack

                Issue deployment