mirror of
https://github.com/milvus-io/milvus.git
synced 2026-07-21 10:15:43 +00:00
test: fix PartialUpdateChecker false failures on SchemaMismatchRetryableException
Same root cause as InsertChecker/UpsertChecker: when AddVectorFieldChecker adds a nullable vector field, the cached schema_timestamp in the SDK becomes stale and the server rejects the upsert with SchemaMismatch (error code 62). Apply the same fix: catch SchemaMismatchRetryableException, invalidate the SDK schema cache via _invalidate_schema(), and retry once. issue: #49329 Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com> Signed-off-by: yanliang567 <82361606+yanliang567@users.noreply.github.com>
This commit is contained in:
co-authored by
Claude Sonnet 4.6
parent
5eb07f0360
commit
8683b71720
@@ -31,8 +31,8 @@ from pymilvus import (
|
||||
connections,
|
||||
)
|
||||
from pymilvus.bulk_writer import BulkFileType, RemoteBulkWriter
|
||||
from pymilvus.exceptions import SchemaMismatchRetryableException
|
||||
from pymilvus.client.embedding_list import EmbeddingList
|
||||
from pymilvus.exceptions import SchemaMismatchRetryableException
|
||||
from pymilvus.milvus_client.index import IndexParams
|
||||
from utils.api_request import Error
|
||||
from utils.util_log import test_log as log
|
||||
@@ -1715,6 +1715,22 @@ class PartialUpdateChecker(Checker):
|
||||
collection_name=self.c_name, data=self.data, partial_update=True, timeout=timeout
|
||||
)
|
||||
return res, True
|
||||
except SchemaMismatchRetryableException:
|
||||
# Schema changed concurrently (AddVectorFieldChecker). Invalidate the SDK schema cache
|
||||
# so the next upsert_rows() fetches the new schema_timestamp, then retry once.
|
||||
log.debug("[PartialUpdateChecker] schema_timestamp stale, invalidating cache and retrying")
|
||||
try:
|
||||
self.milvus_client._get_connection()._invalidate_schema(self.c_name)
|
||||
except Exception:
|
||||
pass
|
||||
try:
|
||||
res = self.milvus_client.upsert(
|
||||
collection_name=self.c_name, data=self.data, partial_update=True, timeout=timeout
|
||||
)
|
||||
return res, True
|
||||
except Exception as e:
|
||||
log.info(f"partial update failed (retry): {e}")
|
||||
return str(e), False
|
||||
except Exception as e:
|
||||
log.info(f"error {e}")
|
||||
return str(e), False
|
||||
|
||||
Reference in New Issue
Block a user