diff --git a/pkg/bootstrap/versions/upgrade_strategy.go b/pkg/bootstrap/versions/upgrade_strategy.go index b520801fffec..a177e79eef13 100644 --- a/pkg/bootstrap/versions/upgrade_strategy.go +++ b/pkg/bootstrap/versions/upgrade_strategy.go @@ -147,7 +147,6 @@ func (u *UpgradeEntry) Upgrade(txn executor.TxnExecutor, accountId uint32) error return err } res.Close() - getLogger().Info("execute upgrade pre-sql completed", zap.String("upgrade entry", u.String())) } // 2. Second, Execute upgrade sql @@ -157,7 +156,6 @@ func (u *UpgradeEntry) Upgrade(txn executor.TxnExecutor, accountId uint32) error return err } res.Close() - getLogger().Info("execute upgrade sql completed", zap.String("upgrade entry", u.String())) // 2. Third, after the upgrade is completed, judge whether there is post-sql if u.PostSql != "" { @@ -167,7 +165,6 @@ func (u *UpgradeEntry) Upgrade(txn executor.TxnExecutor, accountId uint32) error return err } res.Close() - getLogger().Info("execute upgrade post-sql completed", zap.String("upgrade entry", u.String())) } } return nil diff --git a/pkg/bootstrap/versions/upgrade_tenant_task.go b/pkg/bootstrap/versions/upgrade_tenant_task.go index 1f0c7e580a9f..f728a9d2b5e7 100644 --- a/pkg/bootstrap/versions/upgrade_tenant_task.go +++ b/pkg/bootstrap/versions/upgrade_tenant_task.go @@ -56,7 +56,7 @@ func UpdateUpgradeTenantTaskState( taskID uint64, state int32, txn executor.TxnExecutor) error { - sql := fmt.Sprintf("update %s set ready = %d where id = %d", + sql := fmt.Sprintf("update %s set ready = %d, update_at = current_timestamp() where id = %d", catalog.MOUpgradeTenantTable, state, taskID) diff --git a/pkg/bootstrap/versions/v1_2_0/upgrade.go b/pkg/bootstrap/versions/v1_2_0/upgrade.go index e3a339fe0164..4685e0e5e54c 100644 --- a/pkg/bootstrap/versions/v1_2_0/upgrade.go +++ b/pkg/bootstrap/versions/v1_2_0/upgrade.go @@ -16,6 +16,7 @@ package v1_2_0 import ( "context" + "time" "go.uber.org/zap" @@ -66,11 +67,20 @@ func (v *versionHandle) HandleTenantUpgrade( txn executor.TxnExecutor) error { for _, upgEntry := range tenantUpgEntries { + start := time.Now() + err := upgEntry.Upgrade(txn, uint32(tenantID)) if err != nil { getLogger().Error("tenant upgrade entry execute error", zap.Error(err), zap.Int32("tenantId", tenantID), zap.String("version", v.Metadata().Version), zap.String("upgrade entry", upgEntry.String())) return err } + + duration := time.Since(start) + getLogger().Info("tenant upgrade entry complete", + zap.String("upgrade entry", upgEntry.String()), + zap.Int64("time cost(ms)", duration.Milliseconds()), + zap.Int32("tenantId", tenantID), + zap.String("toVersion", v.Metadata().Version)) } return nil @@ -81,11 +91,19 @@ func (v *versionHandle) HandleClusterUpgrade( txn executor.TxnExecutor) error { txn.Use(catalog.MO_CATALOG) for _, upgEntry := range clusterUpgEntries { + start := time.Now() + err := upgEntry.Upgrade(txn, catalog.System_Account) if err != nil { getLogger().Error("cluster upgrade entry execute error", zap.Error(err), zap.String("version", v.Metadata().Version), zap.String("upgrade entry", upgEntry.String())) return err } + + duration := time.Since(start) + getLogger().Info("cluster upgrade entry complete", + zap.String("upgrade entry", upgEntry.String()), + zap.Int64("time cost(ms)", duration.Milliseconds()), + zap.String("toVersion", v.Metadata().Version)) } return nil } diff --git a/pkg/sql/compile/sql_executor.go b/pkg/sql/compile/sql_executor.go index 3fc989f43a99..966b650dc34e 100644 --- a/pkg/sql/compile/sql_executor.go +++ b/pkg/sql/compile/sql_executor.go @@ -255,11 +255,6 @@ func (exec *txnExecutor) Exec( //----------------------------------------------------------------------------------------- receiveAt := time.Now() - - logutil.Info("Received SQL execute request", - zap.String("sql", sql), - zap.String("txn-id", hex.EncodeToString(exec.opts.Txn().Txn().ID))) - stmts, err := parsers.Parse(exec.ctx, dialect.MYSQL, sql, 1, 0) defer func() { for _, stmt := range stmts {