From 2fef14cce49d970e9d8fbef55c914601096f66f3 Mon Sep 17 00:00:00 2001 From: GreatRiver <2552853833@qq.com> Date: Wed, 17 Apr 2024 22:13:51 +0800 Subject: [PATCH] Fix ListSnapshotCheckpoint (#15582) Fix ListSnapshotCheckpoint Approved by: @XuPeng-SH --- pkg/vm/engine/tae/db/checkpoint/snapshot.go | 3 +++ 1 file changed, 3 insertions(+) diff --git a/pkg/vm/engine/tae/db/checkpoint/snapshot.go b/pkg/vm/engine/tae/db/checkpoint/snapshot.go index 25585e54fb861..072eb2384a6fc 100644 --- a/pkg/vm/engine/tae/db/checkpoint/snapshot.go +++ b/pkg/vm/engine/tae/db/checkpoint/snapshot.go @@ -90,6 +90,9 @@ func ListSnapshotCheckpoint( bat.AddVector(colNames[i], vec) } entries, maxGlobalEnd := replayCheckpointEntries(bat, 3) + sort.Slice(entries, func(i, j int) bool { + return entries[i].end.Less(&entries[j].end) + }) for i := range entries { if entries[i].end.Equal(&maxGlobalEnd) && entries[i].entryType == ET_Global { return entries[i:], nil