Solr
  1. Solr
  2. SOLR-7389

Expose znode version in clusterstatus API

    Details

      Description

      We should expose the znode version of the cluster state for each collection that is returned by the clusterstatus API.

      Apart from giving an idea about when the clusterstatus was executed, this information can be used by non-java clients to use the same stateVer mechanism that SolrJ currently uses for routing requests without watching all cluster states.

      1. SOLR-7389.patch
        12 kB
        Shalin Shekhar Mangar
      2. SOLR-7389.patch
        2 kB
        Marius Grama
      3. SOLR-7389.patch
        2 kB
        Marius Grama

        Activity

        Hide
        Marius Grama added a comment -

        Attached the patch to expose znodeVersion property for each of the collections returned for the clusterstatus operation in the collections API.

        Show
        Marius Grama added a comment - Attached the patch to expose znodeVersion property for each of the collections returned for the clusterstatus operation in the collections API.
        Hide
        Shalin Shekhar Mangar added a comment -

        Marius Grama - You attached the wrong file as a patch I guess.

        Show
        Shalin Shekhar Mangar added a comment - Marius Grama - You attached the wrong file as a patch I guess.
        Hide
        Marius Grama added a comment -

        Shalin Shekhar Mangar : indeed. sorry about that. these were my notes (i spent some time trying to understand how where the change needs to be performed)

        Show
        Marius Grama added a comment - Shalin Shekhar Mangar : indeed. sorry about that. these were my notes (i spent some time trying to understand how where the change needs to be performed)
        Hide
        Shalin Shekhar Mangar added a comment -

        Thanks Marius Grama but this is patch isn't quite right. The DocCollection#write method is used to persist the collection information to ZK but we don't want znodeVersion to be persisted to ZK as part of the collection. It is best to add the znodeVersion manually to the collection information being returned by the cluster status API. Look at OverseerCollectionProcessor#getClusterStatus where this is all done. Also, all tests for this API are in TestCollectionAPI so I'd appreciate if you can add a test for this new feature as well.

        Show
        Shalin Shekhar Mangar added a comment - Thanks Marius Grama but this is patch isn't quite right. The DocCollection#write method is used to persist the collection information to ZK but we don't want znodeVersion to be persisted to ZK as part of the collection. It is best to add the znodeVersion manually to the collection information being returned by the cluster status API. Look at OverseerCollectionProcessor#getClusterStatus where this is all done. Also, all tests for this API are in TestCollectionAPI so I'd appreciate if you can add a test for this new feature as well.
        Hide
        Marius Grama added a comment -

        Attached a new patch which adds zNodeVersion property for the collection status representation within OverseerCollectionProcessor#getClusterStatus method.

        Show
        Marius Grama added a comment - Attached a new patch which adds zNodeVersion property for the collection status representation within OverseerCollectionProcessor#getClusterStatus method.
        Hide
        Shalin Shekhar Mangar added a comment -
        1. I simplified the cluster status code to remove the repeated code.
        2. Merged the change given by Marius Grama
        3. Added a test in TestCollectionAPI

        This is ready. I'll commit shortly.

        Show
        Shalin Shekhar Mangar added a comment - I simplified the cluster status code to remove the repeated code. Merged the change given by Marius Grama Added a test in TestCollectionAPI This is ready. I'll commit shortly.
        Hide
        ASF subversion and git services added a comment -

        Commit 1681776 from shalin@apache.org in branch 'dev/trunk'
        [ https://svn.apache.org/r1681776 ]

        SOLR-7389: Expose znodeVersion property for each of the collections returned for the clusterstatus operation in the collections API

        Show
        ASF subversion and git services added a comment - Commit 1681776 from shalin@apache.org in branch 'dev/trunk' [ https://svn.apache.org/r1681776 ] SOLR-7389 : Expose znodeVersion property for each of the collections returned for the clusterstatus operation in the collections API
        Hide
        ASF subversion and git services added a comment -

        Commit 1681777 from shalin@apache.org in branch 'dev/branches/branch_5x'
        [ https://svn.apache.org/r1681777 ]

        SOLR-7389: Expose znodeVersion property for each of the collections returned for the clusterstatus operation in the collections API

        Show
        ASF subversion and git services added a comment - Commit 1681777 from shalin@apache.org in branch 'dev/branches/branch_5x' [ https://svn.apache.org/r1681777 ] SOLR-7389 : Expose znodeVersion property for each of the collections returned for the clusterstatus operation in the collections API
        Hide
        Shalin Shekhar Mangar added a comment -

        Thanks Marius!

        Show
        Shalin Shekhar Mangar added a comment - Thanks Marius!
        Hide
        Marius Grama added a comment -

        Thanks Shalin Shekhar Mangar for adding the test case to ensure the accuracy of this latest change. I missed the fact that this change could have been tested so straightforward within TestCollectionAPI.

        Show
        Marius Grama added a comment - Thanks Shalin Shekhar Mangar for adding the test case to ensure the accuracy of this latest change. I missed the fact that this change could have been tested so straightforward within TestCollectionAPI.
        Hide
        Shalin Shekhar Mangar added a comment -

        No problem, thank you for your contribution!

        Show
        Shalin Shekhar Mangar added a comment - No problem, thank you for your contribution!
        Hide
        Shalin Shekhar Mangar added a comment -

        Bulk close for 5.3.0 release

        Show
        Shalin Shekhar Mangar added a comment - Bulk close for 5.3.0 release

          People

          • Assignee:
            Shalin Shekhar Mangar
            Reporter:
            Shalin Shekhar Mangar
          • Votes:
            0 Vote for this issue
            Watchers:
            3 Start watching this issue

            Dates

            • Created:
              Updated:
              Resolved:

              Development