From 0fa0de7668f78d4256534c161b7be368b04958d9 Mon Sep 17 00:00:00 2001 From: Enwei Jiao Date: Mon, 7 Aug 2023 16:39:22 +0800 Subject: [PATCH] Remove time travel Signed-off-by: Enwei Jiao --- client/data.go | 2 -- client/maintainance.go | 4 ---- client/maintainance_test.go | 5 ----- client/options.go | 9 +++------ 4 files changed, 3 insertions(+), 17 deletions(-) diff --git a/client/data.go b/client/data.go index bc7e82b4..27bbf769 100644 --- a/client/data.go +++ b/client/data.go @@ -222,7 +222,6 @@ func (c *GrpcClient) Query(ctx context.Context, collectionName string, partition OutputFields: outputFields, PartitionNames: partitionNames, GuaranteeTimestamp: option.GuaranteeTimestamp, - TravelTimestamp: option.TravelTimestamp, } if option.Offset > 0 { req.QueryParams = append(req.QueryParams, &common.KeyValuePair{Key: offsetKey, Value: strconv.FormatInt(option.Offset, 10)}) @@ -312,7 +311,6 @@ func prepareSearchRequest(collName string, partitions []string, OutputFields: outputFields, SearchParams: searchParams, GuaranteeTimestamp: opt.GuaranteeTimestamp, - TravelTimestamp: opt.TravelTimestamp, Nq: int64(len(vectors)), } return req, nil diff --git a/client/maintainance.go b/client/maintainance.go index 0af2735f..1cc99168 100644 --- a/client/maintainance.go +++ b/client/maintainance.go @@ -22,7 +22,6 @@ import ( server "github.com/milvus-io/milvus-proto/go-api/v2/milvuspb" "github.com/milvus-io/milvus-sdk-go/v2/entity" - "github.com/milvus-io/milvus-sdk-go/v2/internal/utils/tso" ) // ManualCompaction triggers a compaction on provided collection @@ -39,11 +38,8 @@ func (c *GrpcClient) ManualCompaction(ctx context.Context, collName string, tole return 0, err } - tt := tso.ComposeTSByTime(time.Now().Add(-toleranceDuration), 0) - req := &server.ManualCompactionRequest{ CollectionID: coll.ID, - Timetravel: tt, } resp, err := c.Service.ManualCompaction(ctx, req) diff --git a/client/maintainance_test.go b/client/maintainance_test.go index 52bebd43..ba05a99a 100644 --- a/client/maintainance_test.go +++ b/client/maintainance_test.go @@ -19,7 +19,6 @@ package client import ( "context" "testing" - "time" "github.com/cockroachdb/errors" @@ -27,7 +26,6 @@ import ( common "github.com/milvus-io/milvus-proto/go-api/v2/commonpb" server "github.com/milvus-io/milvus-proto/go-api/v2/milvuspb" "github.com/milvus-io/milvus-sdk-go/v2/entity" - "github.com/milvus-io/milvus-sdk-go/v2/internal/utils/tso" "github.com/stretchr/testify/assert" ) @@ -41,7 +39,6 @@ func TestGrpcManualCompaction(t *testing.T) { compactionID := int64(1001) t.Run("normal manual compaction", func(t *testing.T) { - now := time.Now() mockServer.SetInjection(MDescribeCollection, describeCollectionInjection(t, testCollectionID, testCollectionName, defaultSchema())) defer mockServer.DelInjection(MDescribeCollection) mockServer.SetInjection(MManualCompaction, func(ctx context.Context, raw proto.Message) (proto.Message, error) { @@ -51,8 +48,6 @@ func TestGrpcManualCompaction(t *testing.T) { } assert.Equal(t, testCollectionID, req.GetCollectionID()) - ts, _ := tso.ParseTS(req.GetTimetravel()) - assert.True(t, ts.Sub(now) < time.Second) resp := &server.ManualCompactionResponse{ CompactionID: compactionID, diff --git a/client/options.go b/client/options.go index dc223c01..4ed12af1 100644 --- a/client/options.go +++ b/client/options.go @@ -120,10 +120,9 @@ func WithResourceGroups(rgs []string) LoadCollectionOption { // SearchQueryOption is an option of search/query request type SearchQueryOption struct { - // Consistency Level & Time travel + // Consistency Level ConsistencyLevel entity.ConsistencyLevel GuaranteeTimestamp uint64 - TravelTimestamp uint64 // Pagination Limit int64 Offset int64 @@ -175,11 +174,9 @@ func WithGuaranteeTimestamp(gt uint64) SearchQueryOptionFunc { } } -// WithTravelTimestamp specifies time travel timestamp +// Deprecated: time travel is not supported since v2.3.0 func WithTravelTimestamp(tt uint64) SearchQueryOptionFunc { - return func(option *SearchQueryOption) { - option.TravelTimestamp = tt - } + return func(option *SearchQueryOption) {} } func makeSearchQueryOption(collName string, opts ...SearchQueryOptionFunc) (*SearchQueryOption, error) {