From 880915e08b29d8a44e8cb095f91465105b41d5ca Mon Sep 17 00:00:00 2001 From: congqixia Date: Tue, 17 Jun 2025 10:38:37 +0800 Subject: [PATCH] enhance: Print out-of-date schema ts when returning ErrSchemaMismatch (#42790) Related to #41858 This PR add log while debugging schema mismatch between pymilvus cache and proxy schema. Signed-off-by: Congqi Xia --- internal/proxy/task_insert.go | 6 +++++- internal/proxy/task_upsert.go | 5 ++++- 2 files changed, 9 insertions(+), 2 deletions(-) diff --git a/internal/proxy/task_insert.go b/internal/proxy/task_insert.go index c285b432e9..df48ccd3db 100644 --- a/internal/proxy/task_insert.go +++ b/internal/proxy/task_insert.go @@ -149,7 +149,11 @@ func (it *insertTask) PreExecute(ctx context.Context) error { if it.schemaTimestamp != 0 { if it.schemaTimestamp != colInfo.updateTimestamp { err := merr.WrapErrCollectionSchemaMisMatch(collectionName) - log.Ctx(ctx).Info("collection schema mismatch", zap.String("collectionName", collectionName), zap.Error(err)) + log.Ctx(ctx).Info("collection schema mismatch", + zap.String("collectionName", collectionName), + zap.Uint64("requestSchemaTs", it.schemaTimestamp), + zap.Uint64("collectionSchemaTs", colInfo.updateTimestamp), + zap.Error(err)) return err } } diff --git a/internal/proxy/task_upsert.go b/internal/proxy/task_upsert.go index 5572a17893..4ca000731b 100644 --- a/internal/proxy/task_upsert.go +++ b/internal/proxy/task_upsert.go @@ -340,7 +340,10 @@ func (it *upsertTask) PreExecute(ctx context.Context) error { if it.schemaTimestamp != 0 { if it.schemaTimestamp != colInfo.updateTimestamp { err := merr.WrapErrCollectionSchemaMisMatch(collectionName) - log.Info("collection schema mismatch", zap.String("collectionName", collectionName), zap.Error(err)) + log.Info("collection schema mismatch", zap.String("collectionName", collectionName), + zap.Uint64("requestSchemaTs", it.schemaTimestamp), + zap.Uint64("collectionSchemaTs", colInfo.updateTimestamp), + zap.Error(err)) return err } }