Solr
  1. Solr
  2. SOLR-5620

Race condition while setting ZkStateReader.aliases

    Details

    • Type: Bug Bug
    • Status: Closed
    • Priority: Minor Minor
    • Resolution: Fixed
    • Affects Version/s: 4.6
    • Fix Version/s: 4.7, 6.0
    • Component/s: SolrCloud
    • Labels:
      None

      Description

      Noticed while working on SOLR-5615, https://github.com/apache/lucene-solr/pull/15 for a patch.

        Activity

        Hide
        Ramkumar Aiyengar added a comment -

        I added a synchronized section around updateAliases just for consistency with the Watcher code in my second commit, though I am unsure of why it's even present in the Watcher code in the first place?

        Show
        Ramkumar Aiyengar added a comment - I added a synchronized section around updateAliases just for consistency with the Watcher code in my second commit, though I am unsure of why it's even present in the Watcher code in the first place?
        Hide
        Mark Miller added a comment -

        I think it's actually just left over from back when nodes updated cluster state via retries directly to zk rather than going through the overseer. I think that protected all reads and sets of the state? I'm not sure, I'd have to spend some more time on it. Someone else was involved in a lot of that refactoring, so I don't have a complete memory of it. Not positive if it was even need for the reads then, but who knows what all the code look like at the time.

        I can't see how we need it for reading the aliases though - but we do want that volatile of course.

        Show
        Mark Miller added a comment - I think it's actually just left over from back when nodes updated cluster state via retries directly to zk rather than going through the overseer. I think that protected all reads and sets of the state? I'm not sure, I'd have to spend some more time on it. Someone else was involved in a lot of that refactoring, so I don't have a complete memory of it. Not positive if it was even need for the reads then, but who knows what all the code look like at the time. I can't see how we need it for reading the aliases though - but we do want that volatile of course.
        Hide
        ASF subversion and git services added a comment -

        Commit 1569603 from Mark Miller in branch 'dev/trunk'
        [ https://svn.apache.org/r1569603 ]

        SOLR-5620: ZKStateReader.aliases should be volatile to ensure all threads see the latest aliases.

        Show
        ASF subversion and git services added a comment - Commit 1569603 from Mark Miller in branch 'dev/trunk' [ https://svn.apache.org/r1569603 ] SOLR-5620 : ZKStateReader.aliases should be volatile to ensure all threads see the latest aliases.
        Hide
        ASF subversion and git services added a comment -

        Commit 1569604 from Mark Miller in branch 'dev/branches/branch_4x'
        [ https://svn.apache.org/r1569604 ]

        SOLR-5620: ZKStateReader.aliases should be volatile to ensure all threads see the latest aliases.

        Show
        ASF subversion and git services added a comment - Commit 1569604 from Mark Miller in branch 'dev/branches/branch_4x' [ https://svn.apache.org/r1569604 ] SOLR-5620 : ZKStateReader.aliases should be volatile to ensure all threads see the latest aliases.
        Hide
        ASF subversion and git services added a comment -

        Commit 1569606 from Mark Miller in branch 'dev/branches/lucene_solr_4_7'
        [ https://svn.apache.org/r1569606 ]

        SOLR-5620: ZKStateReader.aliases should be volatile to ensure all threads see the latest aliases.

        Show
        ASF subversion and git services added a comment - Commit 1569606 from Mark Miller in branch 'dev/branches/lucene_solr_4_7' [ https://svn.apache.org/r1569606 ] SOLR-5620 : ZKStateReader.aliases should be volatile to ensure all threads see the latest aliases.
        Hide
        Ramkumar Aiyengar added a comment -

        Thanks for picking up Mark!

        Show
        Ramkumar Aiyengar added a comment - Thanks for picking up Mark!

          People

          • Assignee:
            Mark Miller
            Reporter:
            Ramkumar Aiyengar
          • Votes:
            0 Vote for this issue
            Watchers:
            4 Start watching this issue

            Dates

            • Created:
              Updated:
              Resolved:

              Development