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

Weird behavior of CollectionStateWatcher

    XMLWordPrintableJSON

    Details

    • Type: Bug
    • Status: Open
    • Priority: Major
    • Resolution: Unresolved
    • Affects Version/s: 7.2, 8.0
    • Fix Version/s: None
    • Component/s: None
    • Labels:
      None

      Description

      While working on SOLR-11320 I noticed a strange behavior in ActiveReplicaWatcher, which is a subclass of CollectionStateWatcher - it appears that its onStateChanged method can be called from multiple threads with exactly the same DocCollection state, ie. unchanged between the calls.

      This seems to run contrary to the javadoc, which implies that this method is called only when the state actually changes, and it also doesn't mention anything about the need for thread-safety in the method implementation.

      I attached the log, which has a lot of additional debugging - but the most pertinent part being where a Watcher-s hashCode is printed together with the DocCollection - notice that these overlapping calls both submit an instance of DocCollection with the same zkVersion.

      Scott Blum, Alan Woodward - could you please take a look at this? If this behavior is expected then the javadoc should be updated to state clearly that multiple calls can be made concurrently, with exactly the same state (which is kind of a weak guarantee for a method called onStateChanged ).

        Attachments

        1. test.log
          324 kB
          Andrzej Bialecki

          Issue Links

            Activity

              People

              • Assignee:
                Unassigned
                Reporter:
                ab Andrzej Bialecki
              • Votes:
                0 Vote for this issue
                Watchers:
                2 Start watching this issue

                Dates

                • Created:
                  Updated: