From 6503c24046b7aede6519489e78ab2ef002cb5342 Mon Sep 17 00:00:00 2001 From: Congqi Xia Date: Mon, 16 Oct 2023 11:53:02 +0800 Subject: [PATCH] Remove `Flush` operation before create index Signed-off-by: Congqi Xia --- client/index.go | 5 ----- client/index_test.go | 11 ----------- 2 files changed, 16 deletions(-) diff --git a/client/index.go b/client/index.go index 6f725aae..6b717136 100644 --- a/client/index.go +++ b/client/index.go @@ -90,11 +90,6 @@ func (c *GrpcClient) CreateIndex(ctx context.Context, collName string, fieldName return err } - flushErr := c.Flush(ctx, collName, true) - if flushErr != nil { - return flushErr - } - idxDef := getIndexDef(opts...) req := &milvuspb.CreateIndexRequest{ diff --git a/client/index_test.go b/client/index_test.go index eea34bc8..f1ca827f 100644 --- a/client/index_test.go +++ b/client/index_test.go @@ -41,17 +41,6 @@ func TestGrpcClientCreateIndex(t *testing.T) { assert.Nil(t, c.CreateIndex(ctx, testCollectionName, fieldName, idx, true)) }) - t.Run("test flush err", func(t *testing.T) { - mockServer.SetInjection(MFlush, func(_ context.Context, raw proto.Message) (proto.Message, error) { - resp := &milvuspb.FlushResponse{} - s, err := BadRequestStatus() - resp.Status = s - return resp, err - }) - defer mockServer.DelInjection(MFlush) - assert.NotNil(t, c.CreateIndex(ctx, testCollectionName, fieldName, idx, false)) - }) - t.Run("test sync create index", func(t *testing.T) { buildTime := rand.Intn(900) + 100 start := time.Now()