Skip to content

Commit 95efd8b

Browse files
authored
Fixed the bug that caused GC Verify to panic when running during checkpoint but not completed. (#22434)
Fixed the bug that caused GC Verify to panic when running during checkpoint but not completed. Approved by: @XuPeng-SH
1 parent 1f74599 commit 95efd8b

File tree

2 files changed

+7
-6
lines changed

2 files changed

+7
-6
lines changed

pkg/vm/engine/tae/db/gc/v3/check.go

Lines changed: 7 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -203,14 +203,17 @@ func (c *gcChecker) Verify(ctx context.Context, mp *mpool.MPool) (returnStr stri
203203

204204
// Collect all checkpoint files
205205
var ckpObjectCount int
206-
ckps := c.cleaner.checkpointCli.GetAllGlobalCheckpoints()
207-
ckps = append(ckps, c.cleaner.checkpointCli.GetAllIncrementalCheckpoints()...)
206+
checkpoints := c.cleaner.checkpointCli.GetAllGlobalCheckpoints()
207+
checkpoints = append(checkpoints, c.cleaner.checkpointCli.GetAllIncrementalCheckpoints()...)
208208

209209
compacted := c.cleaner.checkpointCli.GetCompacted()
210210
if compacted != nil {
211-
ckps = append(ckps, compacted)
211+
checkpoints = append(checkpoints, compacted)
212212
}
213-
for _, ckp := range ckps {
213+
for _, ckp := range checkpoints {
214+
if !ckp.IsFinished() {
215+
continue
216+
}
214217
var files []string
215218
files, err = getCheckpointLocation(ctx, ckp, c.cleaner.fs)
216219
if err != nil {

pkg/vm/engine/tae/db/gc/v3/window.go

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -672,7 +672,6 @@ func (w *GCWindow) Details(ctx context.Context, snapshotMeta *logtail.SnapshotMe
672672
for tid, entry := range tables {
673673
accountID, ok := snapshotMeta.GetAccountId(tid)
674674
if !ok {
675-
logutil.Error("GetAccountId is error")
676675
continue
677676
}
678677
if details[accountID] == nil {
@@ -702,7 +701,6 @@ func (w *GCWindow) Details(ctx context.Context, snapshotMeta *logtail.SnapshotMe
702701
for tid, entry := range tables {
703702
accountID, ok := snapshotMeta.GetAccountId(tid)
704703
if !ok {
705-
logutil.Error("GetAccountId is error")
706704
continue
707705
}
708706
if details[accountID] == nil {

0 commit comments

Comments
 (0)