mirror of
https://gitee.com/milvus-io/milvus.git
synced 2024-11-30 10:59:32 +08:00
Add check for stats log and bin log number (#21264)
Signed-off-by: xiaofan-luan <xiaofan.luan@zilliz.com>
This commit is contained in:
parent
1e5cd9dc6e
commit
5d044c4f29
@ -1017,6 +1017,10 @@ func (m *meta) alterMetaStoreAfterCompaction(modSegments []*SegmentInfo, newSegm
|
||||
}
|
||||
log.Info("meta update: alter meta store for compaction updates",
|
||||
zap.Int64s("compact from segments (segments to be updated as dropped)", modSegIDs),
|
||||
zap.Int64("new segmentId", newSegment.GetID()),
|
||||
zap.Int("binlog", len(newSegment.GetBinlogs())),
|
||||
zap.Int("stats log", len(newSegment.GetStatslogs())),
|
||||
zap.Int("delta logs", len(newSegment.GetDeltalogs())),
|
||||
zap.Int64("compact to segment", newSegment.GetID()))
|
||||
|
||||
m.Lock()
|
||||
|
@ -519,6 +519,21 @@ func buildBinlogKvsWithLogID(collectionID, partitionID, segmentID typeutil.Uniqu
|
||||
checkBinlogs(storage.InsertBinlog, segmentID, binlogs)
|
||||
checkBinlogs(storage.DeleteBinlog, segmentID, deltalogs)
|
||||
checkBinlogs(storage.StatsBinlog, segmentID, statslogs)
|
||||
// check stats log and bin log size match
|
||||
if len(binlogs) != 0 && len(statslogs) != 0 {
|
||||
if len(statslogs[0].GetBinlogs()) != len(binlogs[0].GetBinlogs()) {
|
||||
log.Warn("find invalid segment while bin log size didn't match stat log size",
|
||||
zap.Int64("collection", collectionID),
|
||||
zap.Int64("partition", partitionID),
|
||||
zap.Int64("segment", segmentID),
|
||||
zap.Any("binlogs", binlogs),
|
||||
zap.Any("stats", statslogs),
|
||||
zap.Any("delta", deltalogs),
|
||||
)
|
||||
return nil, fmt.Errorf("Segment can not be saved because of binlog "+
|
||||
"file not match stat log number: collection %v, segment %v", collectionID, segmentID)
|
||||
}
|
||||
}
|
||||
|
||||
fillLogIDByLogPath(binlogs, deltalogs, statslogs)
|
||||
kvs, err := buildBinlogKvs(collectionID, partitionID, segmentID, binlogs, deltalogs, statslogs)
|
||||
|
Loading…
Reference in New Issue
Block a user