Skip to content
Open
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
14 changes: 14 additions & 0 deletions weaviate/collections/batch/batch_wrapper.py
Original file line number Diff line number Diff line change
Expand Up @@ -85,6 +85,13 @@ def wait_for_vector_indexing(
logger.debug("Waiting for async indexing to finish...")
time.sleep(0.25)
waiting_count += 1
# Stability check: wait briefly and re-verify to prevent race condition
# where shards report READY + vectorQueueSize=0 while objectCount
# has not yet caught up to the inserted objects.
# See: https://github.com/weaviate/weaviate-python-client/issues/1412
time.sleep(0.5)
if not self.__is_ready(how_many_failures, shards):
return self.wait_for_vector_indexing(shards, how_many_failures)
logger.debug("Async indexing finished!")

def __get_shards_readiness(self, shard: Shard) -> List[bool]:
Expand Down Expand Up @@ -186,6 +193,13 @@ async def wait_for_vector_indexing(
logger.debug("Waiting for async indexing to finish...")
await asyncio.sleep(0.25)
waiting_count += 1
# Stability check: wait briefly and re-verify to prevent race condition
# where shards report READY + vectorQueueSize=0 while objectCount
# has not yet caught up to the inserted objects.
# See: https://github.com/weaviate/weaviate-python-client/issues/1412
await asyncio.sleep(0.5)
if not await self.__is_ready(how_many_failures, shards):
return await self.wait_for_vector_indexing(shards, how_many_failures)
logger.debug("Async indexing finished!")

async def __get_shards_readiness(self, shard: Shard) -> List[bool]:
Expand Down
Loading