pysolr icon indicating copy to clipboard operation
pysolr copied to clipboard

Ignore clusterstate.json. Fixes #224.

Open rokclimb15 opened this issue 4 years ago • 3 comments

Remove clusterstate.json and listener since the node exists but Solr no longer updates it. This resulted in the collections property being overwritten with an empty state. Tested on Solr 7.7.2. Below is log output during a connection/index/search routine. Without clusterstate being watched the ZooKeeper class correctly connects to live_nodes, polls collections, and polls the collection state to get shards.

Updated live nodes: ['172.31.80.126:8983_solr', '172.31.85.226:8983_solr', '172.31.84.9:8983_solr', '172.31.87.69:8983_solr']
Updated aliases: None
Updated collection: ['staging']
Updated collections: {'staging': {'pullReplicas': '0', 'replicationFactor': '2', 'router': {'name': 'compositeId'}, 'maxShardsPerNode': '1', 'autoAddReplicas': 'false', 'nrtReplicas': '2', 'tlogReplicas': '0', 'shards': {'shard1': {'range': '80000000-7fffffff', 'state': 'active', 'replicas': {'core_node3': {'core': 'staging_shard1_replica_n1', 'base_url': 'http://172.31.85.226:8983/solr', 'node_name': '172.31.85.226:8983_solr', 'state': 'recovery_failed', 'type': 'NRT', 'force_set_state': 'false'}, 'core_node4': {'core': 'staging_shard1_replica_n2', 'base_url': 'http://172.31.80.126:8983/solr', 'node_name': '172.31.80.126:8983_solr', 'state': 'active', 'type': 'NRT', 'force_set_state': 'false', 'leader': 'true'}}}}}}

I attempted to run the test suite, but it looks like the Solr package referenced is 404 in the test script. Additionally, Solr 4 is unsupported at this point I think.

rokclimb15 avatar Mar 22 '20 16:03 rokclimb15

Is there any upstream documentation about this being deprecated? We should probably have some sort of documentation / release notes link since I'm assuming there's at least some older version of Solr someone is running where this still works.

acdha avatar Mar 22 '20 19:03 acdha

I wasn't able to find any official documentation, likely because this is the internal API of Solr with ZooKeeper and is subject to change. The "official" way to do this would be to call the Solr HTTP API.

I think it would make sense to do this in the context of a BC release and update the test suite to run Solr >= 7 (supported). I started to do that, but ran into a few snags with config files.

rokclimb15 avatar Mar 22 '20 19:03 rokclimb15

Codecov Report

Merging #315 into master will decrease coverage by 6.60%. The diff coverage is n/a.

Impacted file tree graph

@@            Coverage Diff             @@
##           master     #315      +/-   ##
==========================================
- Coverage   94.35%   87.74%   -6.61%     
==========================================
  Files           7        7              
  Lines        1328     1322       -6     
==========================================
- Hits         1253     1160      -93     
- Misses         75      162      +87     
Impacted Files Coverage Δ
pysolr.py 79.88% <ø> (-9.65%) :arrow_down:
tests/test_cloud.py 46.15% <0.00%> (-53.85%) :arrow_down:

Continue to review full report at Codecov.

Legend - Click here to learn more Δ = absolute <relative> (impact), ø = not affected, ? = missing data Powered by Codecov. Last update 1a8887c...3a11bac. Read the comment docs.

codecov[bot] avatar Apr 17 '20 20:04 codecov[bot]

Please rebase to run the tests.

cclauss avatar Apr 26 '23 08:04 cclauss

@rokclimb15 Please rebase or close.

cclauss avatar Jun 27 '23 16:06 cclauss

Closing in favor of https://github.com/django-haystack/pysolr/pull/426

rokclimb15 avatar Sep 15 '23 14:09 rokclimb15