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

CollectionStateWatcher reports new collections before they really exist

    XMLWordPrintableJSON

Details

    • Bug
    • Status: Open
    • Major
    • Resolution: Unresolved
    • 7.6
    • None
    • clients - java
    • None

    Description

      A CollectionStateWatcher registered via org.apache.solr.common.cloud.ZkStateReader.registerCloudCollectionsListener gets invoked as soon as the CloudSolrClient detects a new collection. This is based on having a watch on the /collections znode. When the CollectionStateWatcher tries to read out information about the new collection via zkStateReader.getClusterState() there is a good chance that no DocCollection can be found. The reason for that is that a DocCollection is based on the state.json below the collection. As this znode is below the collection znode it does need to be created a bit later. So there is a race condition.

      One can run into the same problem if one tries to register a CollectionStateWatcher via ZkStateReader.registerCollectionStateWatcher straight after a new collection is found. The watcher is then being invoked with the DocCollection set to null as it also can not find the DocCollection object. Null does however indicate that the collection was being deleted.

      see also the mail thread about this:
      https://www.mail-archive.com/search?l=solr-user@lucene.apache.org&q=subject:%22Re%5C%3A+CloudSolrClient+getDocCollection%22&o=newest&f=1

      Attachments

        Activity

          People

            Unassigned Unassigned
            HendrikH Hendrik Haddorp
            Votes:
            0 Vote for this issue
            Watchers:
            1 Start watching this issue

            Dates

              Created:
              Updated: