Skip to content

Commit

Permalink
fix compact case due to segment sorted
Browse files Browse the repository at this point in the history
Signed-off-by: ThreadDao <[email protected]>
  • Loading branch information
ThreadDao committed Sep 9, 2024
1 parent 45e4e60 commit 878e052
Showing 1 changed file with 9 additions and 9 deletions.
18 changes: 9 additions & 9 deletions test/testcases/compact_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -30,15 +30,6 @@ func TestCompact(t *testing.T) {
mc.Flush(ctx, collName, false)
}

// get persisted segments
segments, _ := mc.GetPersistentSegmentInfo(ctx, collName)
require.Len(t, segments, 4)
segIds := make([]int64, 0, 4)
for _, seg := range segments {
require.Equal(t, seg.NumRows, int64(common.DefaultNb))
segIds = append(segIds, seg.ID)
}

indexHnsw, _ := entity.NewIndexHNSW(entity.L2, 8, 96)
indexBinary, _ := entity.NewIndexBinIvfFlat(entity.JACCARD, 64)
for _, field := range common.AllFloatVectorsFieldNames {
Expand All @@ -48,6 +39,15 @@ func TestCompact(t *testing.T) {
err := mc.CreateIndex(ctx, collName, common.DefaultBinaryVecFieldName, indexBinary, false)
common.CheckErr(t, err, true)

// get persisted segments
segments, _ := mc.GetPersistentSegmentInfo(ctx, collName)
require.Len(t, segments, 4)
segIds := make([]int64, 0, 4)
for _, seg := range segments {
require.Equal(t, seg.NumRows, int64(common.DefaultNb))
segIds = append(segIds, seg.ID)
}

// compact
compactionID, errCompact := mc.Compact(ctx, collName, 100)
common.CheckErr(t, errCompact, true)
Expand Down

0 comments on commit 878e052

Please sign in to comment.