feat: Check per-node shard status in wait_for_vector_indexing - #2127
feat: Check per-node shard status in wait_for_vector_indexing#2127bevzzz wants to merge 11 commits into
Conversation
There was a problem hiding this comment.
Orca Security Scan Summary
| Status | Check | Issues by priority | |
|---|---|---|---|
| Infrastructure as Code | View in Orca | ||
| SAST | View in Orca | ||
| Secrets | View in Orca | ||
| Vulnerabilities | View in Orca |
Codecov Report❌ Patch coverage is
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. 🚀 New features to boost your workflow:
|
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
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
ce71fb3 to
05b3195
Compare
05b3195 to
4f3d340
Compare
| name: str | ||
| status: ShardTypes | ||
| vector_queue_size: int | ||
| status: Optional[ShardTypes] |
There was a problem hiding this comment.
With the change on the server, should this go back to being ShardTypes?
Server will continue to send back the deprecated value for 'status'.
| else: | ||
| assert shards[0].status == "READY" |
There was a problem hiding this comment.
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
There was a problem hiding this comment.
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?
There was a problem hiding this comment.
Like in wait_for_vector_indexing, we prefer per_node_status.
weaviate-python-client/weaviate/collections/batch/batch_wrapper.py
Lines 99 to 104 in 649c6d6
and not
all(
status == "READY"
for status in cast(dict[str, str], shard.get("per_node_status", {})).values()
) and cast(str, shard["status"]) == "READY"There was a problem hiding this comment.
I walked around a bit and realized that all("READY") implies shard.status == "READY".
Sorry for the confusion, will update.
| for status in cast(dict[str, str], shard["per_node_status"]).values() | ||
| ) | ||
| if "per_node_status" in shard | ||
| else cast(str, shard["status"]) == "READY" |
There was a problem hiding this comment.
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?
There was a problem hiding this comment.
@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?
This PR is going to deprecate
shard.statusandshard.vectorQueueSizefields and introduceper_node_statusin its stead. We need to updatewait_for_vector_indexingto use this information when waiting for shards to get READY.