fix: clamp dashboard cdc position gap

This commit is contained in:
zhx 2026-05-23 13:00:15 +08:00
parent db491b92e5
commit 05b35159b2

View File

@ -138,9 +138,12 @@ func positionMap(pos mysql.Position) map[string]interface{} {
}
func positionGap(master mysql.Position, checkpoint mysql.Position) interface{} {
if master.Name == "" || checkpoint.Name == "" || master.Name != checkpoint.Name || master.Pos < checkpoint.Pos {
if master.Name == "" || checkpoint.Name == "" || master.Name != checkpoint.Name {
return nil
}
if master.Pos < checkpoint.Pos {
return uint32(0)
}
return master.Pos - checkpoint.Pos
}