Skip to content

Commit

Permalink
Remove time travel
Browse files Browse the repository at this point in the history
Signed-off-by: Enwei Jiao <enwei.jiao@zilliz.com>
  • Loading branch information
jiaoew1991 committed Aug 7, 2023
1 parent f751fb2 commit 0fa0de7
Show file tree
Hide file tree
Showing 4 changed files with 3 additions and 17 deletions.
2 changes: 0 additions & 2 deletions client/data.go
Original file line number Diff line number Diff line change
Expand Up @@ -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)})
Expand Down Expand Up @@ -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
Expand Down
4 changes: 0 additions & 4 deletions client/maintainance.go
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand All @@ -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)
Expand Down
5 changes: 0 additions & 5 deletions client/maintainance_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -19,15 +19,13 @@ package client
import (
"context"
"testing"
"time"

"github.com/cockroachdb/errors"

"github.com/golang/protobuf/proto"
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"
)

Expand All @@ -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) {
Expand All @@ -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,
Expand Down
9 changes: 3 additions & 6 deletions client/options.go
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down Expand Up @@ -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) {
Expand Down

0 comments on commit 0fa0de7

Please sign in to comment.