From 6ac85e5cfec56e4968ac33fc4ad356ed12d62955 Mon Sep 17 00:00:00 2001 From: foxspy Date: Wed, 28 May 2025 12:00:29 +0800 Subject: [PATCH] fix: [2.5] add describeIndex timestamp for restful interface (#42105) issue: https://github.com/milvus-io/milvus/issues/41431 pr: #42104 Signed-off-by: xianliang.li --- internal/distributed/proxy/httpserver/handler_v2.go | 3 +++ internal/distributed/proxy/httpserver/request_v2.go | 9 ++++++++- 2 files changed, 11 insertions(+), 1 deletion(-) diff --git a/internal/distributed/proxy/httpserver/handler_v2.go b/internal/distributed/proxy/httpserver/handler_v2.go index 60c65ca75c..89c97eeb2d 100644 --- a/internal/distributed/proxy/httpserver/handler_v2.go +++ b/internal/distributed/proxy/httpserver/handler_v2.go @@ -2240,10 +2240,13 @@ func (h *HandlersV2) listIndexes(ctx context.Context, c *gin.Context, anyReq any func (h *HandlersV2) describeIndex(ctx context.Context, c *gin.Context, anyReq any, dbName string) (interface{}, error) { collectionGetter, _ := anyReq.(requestutil.CollectionNameGetter) indexGetter, _ := anyReq.(IndexNameGetter) + timeGetter, _ := anyReq.(TimestampGetter) + req := &milvuspb.DescribeIndexRequest{ DbName: dbName, CollectionName: collectionGetter.GetCollectionName(), IndexName: indexGetter.GetIndexName(), + Timestamp: timeGetter.GetTimestamp(), } c.Set(ContextRequest, req) diff --git a/internal/distributed/proxy/httpserver/request_v2.go b/internal/distributed/proxy/httpserver/request_v2.go index 4876bc9e89..eea86c3858 100644 --- a/internal/distributed/proxy/httpserver/request_v2.go +++ b/internal/distributed/proxy/httpserver/request_v2.go @@ -352,7 +352,9 @@ type OptionsGetter interface { type JobIDGetter interface { GetJobID() string } - +type TimestampGetter interface { + GetTimestamp() uint64 +} type PasswordReq struct { UserName string `json:"userName" binding:"required"` Password string `json:"password" binding:"required"` @@ -422,6 +424,7 @@ type IndexReq struct { DbName string `json:"dbName"` CollectionName string `json:"collectionName" binding:"required"` IndexName string `json:"indexName" binding:"required"` + Timestamp uint64 `json:"timestamp"` } func (req *IndexReq) GetDbName() string { return req.DbName } @@ -433,6 +436,10 @@ func (req *IndexReq) GetIndexName() string { return req.IndexName } +func (req *IndexReq) GetTimestamp() uint64 { + return req.Timestamp +} + type IndexReqWithProperties struct { DbName string `json:"dbName"` CollectionName string `json:"collectionName" binding:"required"`