Skip to content

Commit

Permalink
fix UT failures and code check breaks
Browse files Browse the repository at this point in the history
Signed-off-by: Ted Xu <[email protected]>
  • Loading branch information
tedxu committed Jan 6, 2025
1 parent b574767 commit 948a29f
Show file tree
Hide file tree
Showing 2 changed files with 5 additions and 15 deletions.
10 changes: 5 additions & 5 deletions internal/flushcommon/syncmgr/pack_writer.go
Original file line number Diff line number Diff line change
Expand Up @@ -203,10 +203,10 @@ func (bw *BulkPackWriter) writeStats(ctx context.Context, pack *SyncPack) (map[i

pkFieldID := serializer.pkField.GetFieldID()
binlogs := make([]*datapb.Binlog, 0)
if batchStatsBlob, err := bw.writeLog(ctx, batchStatsBlob, common.SegmentStatslogPath, pack, pkFieldID, bw.nextID()); err != nil {
if binlog, err := bw.writeLog(ctx, batchStatsBlob, common.SegmentStatslogPath, pack, pkFieldID, bw.nextID()); err != nil {
return nil, err
} else {
binlogs = append(binlogs, batchStatsBlob)
binlogs = append(binlogs, binlog)
}

if pack.isFlush && pack.level != datapb.SegmentLevel_L0 {
Expand All @@ -215,11 +215,11 @@ func (bw *BulkPackWriter) writeStats(ctx context.Context, pack *SyncPack) (map[i
return nil, err
}

if mergedStatsBlob, err := bw.writeLog(ctx, mergedStatsBlob, common.SegmentStatslogPath, pack, pkFieldID, int64(storage.CompoundStatsType)); err != nil {
binlog, err := bw.writeLog(ctx, mergedStatsBlob, common.SegmentStatslogPath, pack, pkFieldID, int64(storage.CompoundStatsType))
if err != nil {
return nil, err
} else {
binlogs = append(binlogs, mergedStatsBlob)
}
binlogs = append(binlogs, binlog)
}

logs := make(map[int64]*datapb.FieldBinlog)
Expand Down
10 changes: 0 additions & 10 deletions internal/flushcommon/writebuffer/l0_write_buffer_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -208,16 +208,6 @@ func (s *L0WriteBufferSuite) TestBufferData() {
})
}

func (s *L0WriteBufferSuite) TestCreateFailure() {
metacache := metacache.NewMockMetaCache(s.T())
metacache.EXPECT().Collection().Return(s.collID)
metacache.EXPECT().Schema().Return(&schemapb.CollectionSchema{})
_, err := NewL0WriteBuffer(s.channelName, metacache, s.syncMgr, &writeBufferOption{
idAllocator: s.allocator,
})
s.Error(err)
}

func TestL0WriteBuffer(t *testing.T) {
suite.Run(t, new(L0WriteBufferSuite))
}

0 comments on commit 948a29f

Please sign in to comment.