Skip to content

feat: Check per-node shard status in wait_for_vector_indexing - #2127

Open
bevzzz wants to merge 11 commits into
mainfrom
fix/wait-for-vector-indexing
Open

feat: Check per-node shard status in wait_for_vector_indexing#2127
bevzzz wants to merge 11 commits into
mainfrom
fix/wait-for-vector-indexing

Conversation

@bevzzz

@bevzzz bevzzz commented Aug 11, 2026

Copy link
Copy Markdown
Collaborator

This PR is going to deprecate shard.status and shard.vectorQueueSize fields and introduce per_node_status in its stead. We need to update wait_for_vector_indexing to use this information when waiting for shards to get READY.

@bevzzz
bevzzz requested a review from tsmith023 August 11, 2026 11:26

@orca-security-eu orca-security-eu Bot left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Orca Security Scan Summary

Status Check Issues by priority
Passed Passed Infrastructure as Code high 0   medium 0   low 0   info 0 View in Orca
Passed Passed SAST high 0   medium 0   low 0   info 0 View in Orca
Passed Passed Secrets high 0   medium 0   low 0   info 0 View in Orca
Passed Passed Vulnerabilities high 0   medium 0   low 0   info 0 View in Orca

@codecov-commenter

codecov-commenter commented Aug 11, 2026

Copy link
Copy Markdown

Codecov Report

❌ Patch coverage is 65.00000% with 7 lines in your changes missing coverage. Please review.
✅ Project coverage is 88.53%. Comparing base (95b5d76) to head (649c6d6).
⚠️ Report is 79 commits behind head on main.

Files with missing lines Patch % Lines
integration/test_batch_v4.py 54.54% 5 Missing ⚠️
integration/test_collection_config.py 75.00% 2 Missing ⚠️
Additional details and impacted files
@@            Coverage Diff             @@
##             main    #2127      +/-   ##
==========================================
+ Coverage   86.64%   88.53%   +1.88%     
==========================================
  Files         300      304       +4     
  Lines       23172    23471     +299     
==========================================
+ Hits        20077    20779     +702     
+ Misses       3095     2692     -403     

☔ View full report in Codecov by Harness.
📢 Have feedback on the report? Share it here.

🚀 New features to boost your workflow:
  • ❄️ Test Analytics: Detect flaky tests, report on failures, and find test suite problems.

bevzzz added a commit to weaviate/weaviate that referenced this pull request Aug 11, 2026
The linked PR adds per_node_status to the Python client and
enables us to wait_for_vector_indexing correctly.

weaviate/weaviate-python-client#2127
bevzzz added a commit to weaviate/weaviate that referenced this pull request Aug 13, 2026
The linked PR adds per_node_status to the Python client and
enables us to wait_for_vector_indexing correctly.

weaviate/weaviate-python-client#2127
@bevzzz
bevzzz force-pushed the fix/wait-for-vector-indexing branch from ce71fb3 to 05b3195 Compare August 13, 2026 15:55
@bevzzz
bevzzz force-pushed the fix/wait-for-vector-indexing branch from 05b3195 to 4f3d340 Compare August 13, 2026 15:56
Comment thread weaviate/collections/classes/config.py Outdated
name: str
status: ShardTypes
vector_queue_size: int
status: Optional[ShardTypes]

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

With the change on the server, should this go back to being ShardTypes?

Copy link
Copy Markdown
Collaborator Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Agree, reverted.

Server will continue to send back the deprecated value for 'status'.
bevzzz added a commit to weaviate/weaviate that referenced this pull request Aug 17, 2026
Comment thread integration/test_collection_config.py Outdated
Comment thread integration/test_collection_config.py Outdated
Comment thread integration/test_collection_config.py Outdated
Comment on lines +792 to +793
else:
assert shards[0].status == "READY"

@tsmith023 tsmith023 Aug 18, 2026

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Ah, I also meant that it should be unconditional on this if statement too. So the L90 replacement would be reintroduced, i.e. the test asserts that it always gets shards[0].status == "READY" back thereby preserving BC. Likewise below

Copy link
Copy Markdown
Collaborator Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Ah, I also meant that it should be unconditional on this if statement too

I don't quite understand why. We know that shards.status is a source of flakiness in tests. Wouldn't we want to avoid relying on it if possible?

thereby preserving BC

This is test code though. What compatibility would we be preserving?

Copy link
Copy Markdown
Collaborator Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Like in wait_for_vector_indexing, we prefer per_node_status.

all(
status == "READY"
for status in cast(dict[str, str], shard["per_node_status"]).values()
)
if "per_node_status" in shard
else cast(str, shard["status"]) == "READY"

and not

 all( 
     status == "READY" 
     for status in cast(dict[str, str], shard.get("per_node_status", {})).values() 
 ) and cast(str, shard["status"]) == "READY"

Copy link
Copy Markdown
Collaborator Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I walked around a bit and realized that all("READY") implies shard.status == "READY".
Sorry for the confusion, will update.

Comment thread weaviate/collections/classes/config.py Outdated
for status in cast(dict[str, str], shard["per_node_status"]).values()
)
if "per_node_status" in shard
else cast(str, shard["status"]) == "READY"

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

If "per_node_status" is missing from shard because no shard could be retrieved (not sure if this can happen from server side), we would move to the else statement, in which case the status will be also empty because we couldn't retrieve any state and accessing directly shard["status"] will error. Could you double check if this scenario is even possible?

@bevzzz bevzzz Aug 20, 2026

Copy link
Copy Markdown
Collaborator Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@tsmith023 Jose and I discussed the possibility of adding UNAVAILABLE status to represent nodes which the coordinator couldn't reach. Currently, when a node fails to respond it will be missing from the shard's per_node_status and the caller will need to know the what the replication factor is to detect that.

WDYT?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

4 participants