-
Notifications
You must be signed in to change notification settings - Fork 142
feat: Check per-node shard status in wait_for_vector_indexing #2127
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
base: main
Are you sure you want to change the base?
Changes from all commits
90a6d57
57c216b
36ee869
2d7ba9b
e2fccfd
4f3d340
b82cd81
d81b694
649c6d6
86495f9
7e17e1a
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
| Original file line number | Diff line number | Diff line change |
|---|---|---|
|
|
@@ -93,9 +93,16 @@ def __get_shards_readiness(self, shard: Shard) -> List[bool]: | |
|
|
||
| res = _decode_json_response_list(response, "Get shards' status") | ||
| assert res is not None | ||
|
|
||
| return [ | ||
| (cast(str, shard.get("status")) == "READY") | ||
| & (cast(int, shard.get("vectorQueueSize")) == 0) | ||
| ( | ||
| 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" | ||
|
Contributor
There was a problem hiding this comment. Choose a reason for hiding this commentThe 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?
Collaborator
Author
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. @tsmith023 Jose and I discussed the possibility of adding WDYT?
Collaborator
Author
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Working on this in weaviate/weaviate#12757 The changes there won't require an update in the Python client, so I'm going to proceed with merging this. |
||
| ) | ||
| for shard in res | ||
| ] | ||
|
|
||
|
|
@@ -195,8 +202,14 @@ async def __get_shards_readiness(self, shard: Shard) -> List[bool]: | |
| res = _decode_json_response_list(response, "Get shards' status") | ||
| assert res is not None | ||
| return [ | ||
| (cast(str, shard.get("status")) == "READY") | ||
| & (cast(int, shard.get("vectorQueueSize")) == 0) | ||
| ( | ||
| 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" | ||
| ) | ||
| for shard in res | ||
| ] | ||
|
|
||
|
|
||
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This will pass even though one of the replicas is missing, as if a replica is not available no information for that node is being dropped in the map. So in a 5 node cluster (weaviate-0: READY, weaviate-1: READY, weaviate-2: READY, weaviate-4: READY) will return True, while we don't know anything from the node weaviate-4.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I had the comment in pending...although I imagine, if you now place the UNAVAILABLE state for every single node, the logic will be precise
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Yeah, I think with the new status we shouldn't be leaving any nodes out of that list so each status will be checked