Skip to content

Commit

Permalink
update 5
Browse files Browse the repository at this point in the history
  • Loading branch information
XuPeng-SH committed Dec 22, 2024
1 parent b11a795 commit d28c3d5
Show file tree
Hide file tree
Showing 2 changed files with 13 additions and 0 deletions.
10 changes: 10 additions & 0 deletions pkg/vm/engine/tae/db/checkpoint/testutils.go
Original file line number Diff line number Diff line change
Expand Up @@ -144,6 +144,14 @@ func (r *runner) ForceIncrementalCheckpoint(ts types.TS) (err error) {
if intent == nil {
return
}

entry := intent.(*CheckpointEntry)

if entry.end.LT(&ts) || !entry.AllChecked() {
err = ErrPendingCheckpoint
return
}

// TODO: use context
timeout := time.After(time.Minute * 2)
now := time.Now()
Expand All @@ -160,6 +168,8 @@ func (r *runner) ForceIncrementalCheckpoint(ts types.TS) (err error) {
)
}()

r.incrementalCheckpointQueue.Enqueue(struct{}{})

select {
case <-r.ctx.Done():
err = context.Cause(r.ctx)
Expand Down
3 changes: 3 additions & 0 deletions pkg/vm/engine/tae/db/checkpoint/types.go
Original file line number Diff line number Diff line change
Expand Up @@ -17,12 +17,15 @@ package checkpoint
import (
"context"

"github.com/matrixorigin/matrixone/pkg/common/moerr"
"github.com/matrixorigin/matrixone/pkg/container/types"
"github.com/matrixorigin/matrixone/pkg/vm/engine/tae/catalog"
"github.com/matrixorigin/matrixone/pkg/vm/engine/tae/common"
"github.com/matrixorigin/matrixone/pkg/vm/engine/tae/containers"
)

var ErrPendingCheckpoint = moerr.NewPrevCheckpointNotFinished()

type State int8

const (
Expand Down

0 comments on commit d28c3d5

Please sign in to comment.