mirror of
https://gitee.com/milvus-io/milvus.git
synced 2025-12-28 14:35:27 +08:00
fix: call truncate when checkpoint is persisted (#46382)
issue: #44434 Signed-off-by: tinswzy <zhenyuan.wei@zilliz.com>
This commit is contained in:
parent
bfc33130be
commit
9345caa135
@ -143,9 +143,23 @@ func (rs *recoveryStorageImpl) persistDirtySnapshot(ctx context.Context, lvl zap
|
||||
|
||||
// sample the checkpoint for truncator to make wal truncation.
|
||||
rs.metrics.ObServePersistedMetrics(snapshot.Checkpoint.TimeTick)
|
||||
rs.simpleTruncateCheckpoint(ctx, snapshot.Checkpoint)
|
||||
return
|
||||
}
|
||||
|
||||
func (rs *recoveryStorageImpl) simpleTruncateCheckpoint(ctx context.Context, checkpoint *WALCheckpoint) {
|
||||
flusherCP := rs.getFlusherCheckpoint()
|
||||
if flusherCP == nil {
|
||||
return
|
||||
}
|
||||
// use the smaller one to truncate the wal.
|
||||
if flusherCP.MessageID.LTE(checkpoint.MessageID) {
|
||||
_ = rs.truncator.Truncate(ctx, flusherCP.MessageID)
|
||||
} else {
|
||||
_ = rs.truncator.Truncate(ctx, checkpoint.MessageID)
|
||||
}
|
||||
}
|
||||
|
||||
// dropAllVirtualChannel drops all virtual channels that are in the dropped state.
|
||||
// TODO: DropVirtualChannel will be called twice here,
|
||||
// call it in recovery storage is used to promise the drop virtual channel must be called after recovery.
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user