Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Prepare for snapshot read refactor 1 #21441

Open
wants to merge 4 commits into
base: main
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
215 changes: 159 additions & 56 deletions pkg/pb/statsinfo/statsinfo.pb.go

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

41 changes: 25 additions & 16 deletions pkg/vm/engine/disttae/db.go
Original file line number Diff line number Diff line change
Expand Up @@ -33,7 +33,6 @@ import (
"github.com/matrixorigin/matrixone/pkg/pb/timestamp"
"github.com/matrixorigin/matrixone/pkg/sql/plan/function/ctl"
"github.com/matrixorigin/matrixone/pkg/util/fault"
"github.com/matrixorigin/matrixone/pkg/vm/engine"
"github.com/matrixorigin/matrixone/pkg/vm/engine/cmd_util"
"github.com/matrixorigin/matrixone/pkg/vm/engine/disttae/cache"
"github.com/matrixorigin/matrixone/pkg/vm/engine/disttae/logtailreplay"
Expand Down Expand Up @@ -359,7 +358,7 @@ func (e *Engine) init(ctx context.Context) error {

e.catalog.Store(newcache)
// clear all tables in global stats.
e.globalStats.clearTables()
//e.globalStats.clearTables()

return nil
}
Expand Down Expand Up @@ -651,19 +650,21 @@ func (e *Engine) GetOrCreateLatestPart(

func (e *Engine) LazyLoadLatestCkp(
ctx context.Context,
tblHandler engine.Relation) (*logtailreplay.Partition, error) {
tableID uint64,
tableName string,
dbID uint64,
dbName string) (*logtailreplay.Partition, error) {

var (
ok bool
tbl *txnTable
//ok bool
//tbl *txnTable
)
//if tbl, ok = tblHandler.(*txnTable); !ok {
// delegate := tblHandler.(*txnTableDelegate)
// tbl = delegate.origin
//}

if tbl, ok = tblHandler.(*txnTable); !ok {
delegate := tblHandler.(*txnTableDelegate)
tbl = delegate.origin
}

part := e.GetOrCreateLatestPart(tbl.db.databaseId, tbl.tableId)
part := e.GetOrCreateLatestPart(dbID, tableID)
cache := e.GetLatestCatalogCache()

if err := part.ConsumeCheckpoints(
Expand All @@ -673,10 +674,10 @@ func (e *Engine) LazyLoadLatestCkp(
ctx,
e.service,
checkpoint,
tbl.tableId,
tbl.tableName,
tbl.db.databaseId,
tbl.db.databaseName,
tableID,
tableName,
dbID,
dbName,
e.mp,
e.fs)
if err != nil {
Expand All @@ -690,7 +691,15 @@ func (e *Engine) LazyLoadLatestCkp(
}
}()
for _, entry := range entries {
if err = consumeEntry(ctx, tbl.primarySeqnum, e, cache, state, entry, false); err != nil {
//the primarySeqnum is not used in the consume of checkpoint.
if err = consumeEntry(
ctx,
-1,
e,
cache,
state,
entry,
false); err != nil {
return err
}
}
Expand Down
2 changes: 1 addition & 1 deletion pkg/vm/engine/disttae/engine.go
Original file line number Diff line number Diff line change
Expand Up @@ -777,7 +777,7 @@ func (e *Engine) cleanMemoryTableWithTable(dbId, tblId uint64) {

// When removing the PartitionState, you need to remove the tid in globalStats,
// When re-subscribing, globalStats will wait for the PartitionState to be consumed before updating the object state.
e.globalStats.RemoveTid(tblId)
//e.globalStats.RemoveTid(tblId)
logutil.Debugf("clean memory table of tbl[dbId: %d, tblId: %d]", dbId, tblId)
}

Expand Down
Loading
Loading