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

Add debug log for 2.0.1 #20729

Merged
merged 1 commit into from
Dec 11, 2024
Merged
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
4 changes: 3 additions & 1 deletion pkg/vm/engine/tae/txn/txnimpl/store.go
Original file line number Diff line number Diff line change
Expand Up @@ -746,7 +746,9 @@ func (store *txnStore) PrePrepare(ctx context.Context) (err error) {
}
approxSize := store.approxSize()
if approxSize > MaxWalSize {
return moerr.NewInternalError(ctx, fmt.Sprintf("WAL entry approxSize %d is too large, max is %d", approxSize, MaxWalSize))
return moerr.NewInternalError(
ctx, fmt.Sprintf("Txn %x WAL entry approxSize %d is too large, max is %d", store.txn.GetID(), approxSize, MaxWalSize),
)
}
if approxSize > 50*mpool.MB {
logutil.Warnf("[Large-WAL-Entry]txn %x, WAL entry approxSize %d", store.txn.GetID(), approxSize)
Expand Down
13 changes: 13 additions & 0 deletions pkg/vm/engine/tae/txn/txnimpl/table.go
Original file line number Diff line number Diff line change
Expand Up @@ -1157,6 +1157,19 @@ func (tbl *txnTable) DoPrecommitDedupByPK(
pksZM index.ZM,
isTombstone bool,
) (err error) {
start := time.Now()
defer func() {
duration := time.Since(start)
if duration > time.Second {
logutil.Info(
"SLOW-LOG-DoPrecommitDedupByPK",
zap.String("txn", tbl.store.txn.String()),
zap.String("table", tbl.GetLocalSchema(isTombstone).Name),
zap.Bool("is-tombstone", isTombstone),
zap.Duration("duration", time.Since(start)),
)
}
}()
moprobe.WithRegion(context.Background(), moprobe.TxnTableDoPrecommitDedupByPK, func() {
var rowIDs containers.Vector
rowIDs, err = tbl.getBaseTable(isTombstone).preCommitGetRowsByPK(tbl.store.ctx, pks)
Expand Down
9 changes: 9 additions & 0 deletions pkg/vm/engine/tae/txn/txnimpl/txndb.go
Original file line number Diff line number Diff line change
Expand Up @@ -29,6 +29,7 @@ import (
"github.com/matrixorigin/matrixone/pkg/vm/engine/tae/containers"
"github.com/matrixorigin/matrixone/pkg/vm/engine/tae/iface/handle"
"github.com/matrixorigin/matrixone/pkg/vm/engine/tae/iface/txnif"
"go.uber.org/zap"
)

type txnDB struct {
Expand Down Expand Up @@ -483,6 +484,14 @@ func (db *txnDB) PrePrepare(ctx context.Context) (err error) {
}
}
v2.TxnTNPrePrepareDeduplicateDurationHistogram.Observe(time.Since(now).Seconds())
if time.Since(now) > time.Second {
logutil.Info(
"SLOW-LOG-PrePrepareDedup",
zap.String("txn", db.store.txn.String()),
zap.String("db", db.entry.GetName()),
zap.Duration("duration", time.Since(now)),
)
}

for _, table := range db.tables {
if err = table.PrePrepare(); err != nil {
Expand Down
Loading