Skip to content

Commit

Permalink
notify global stats
Browse files Browse the repository at this point in the history
  • Loading branch information
gouhongshen committed Jan 17, 2025
1 parent 4477346 commit 0121976
Show file tree
Hide file tree
Showing 2 changed files with 7 additions and 1 deletion.
3 changes: 2 additions & 1 deletion pkg/vm/engine/disttae/mo_table_stats.go
Original file line number Diff line number Diff line change
Expand Up @@ -2245,10 +2245,11 @@ func subscribeTable(
databaseName: tbl.dbName,
}

txnTbl.eng = eng
txnTbl.relKind = tbl.relKind
txnTbl.primarySeqnum = tbl.pkSequence

if pState, err = eng.(*Engine).PushClient().toSubscribeTable(ctx, &txnTbl); err != nil {
if pState, err = txnTbl.tryToSubscribe(ctx); err != nil {
return nil, err
}

Expand Down
5 changes: 5 additions & 0 deletions pkg/vm/engine/disttae/txn_table.go
Original file line number Diff line number Diff line change
Expand Up @@ -1240,6 +1240,11 @@ func (tbl *txnTable) isCreatedInTxn(ctx context.Context) (bool, error) {
return tbl.createdInTxn, nil
}

// test or mo_table_stats
if tbl.db.op == nil {
return false, nil
}

if tbl.db.op.IsSnapOp() || catalog.IsSystemTable(tbl.tableId) {
// if the operation is snapshot read, isCreatedInTxn can not be called by AlterTable
// So if the snapshot read want to subcribe logtail tail, let it go ahead.
Expand Down

0 comments on commit 0121976

Please sign in to comment.