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

ddl: admin show ddl jobs output confusing with multiple jobs #1210

Merged
merged 5 commits into from
Apr 26, 2021
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
3 changes: 3 additions & 0 deletions model/ddl.go
Original file line number Diff line number Diff line change
Expand Up @@ -215,6 +215,9 @@ type Job struct {
SchemaState SchemaState `json:"schema_state"`
// SnapshotVer means snapshot version for this job.
SnapshotVer uint64 `json:"snapshot_ver"`
// RealStartTS uses timestamp allocated by TSO.
// Now it's the TS when we actually start the job.
RealStartTS uint64 `json:"real_start_ts"`
// StartTS uses timestamp allocated by TSO.
// Now it's the TS when we put the job to TiKV queue.
StartTS uint64 `json:"start_ts"`
Expand Down
12 changes: 6 additions & 6 deletions model/model.go
Original file line number Diff line number Diff line change
Expand Up @@ -42,7 +42,7 @@ const (
StateDeleteReorganization
// StatePublic means this schema element is ok for all write and read operations.
StatePublic
// StateReplica means we're waiting tiflash replica to be finished.
// StateReplicaOnly means we're waiting tiflash replica to be finished.
StateReplicaOnly
// StateGlobalTxnOnly means we can only use global txn for operator on this schema element
StateGlobalTxnOnly
Expand All @@ -69,7 +69,7 @@ func (s SchemaState) String() string {
case StateGlobalTxnOnly:
return "global txn only"
default:
return "none"
return "queueing"
}
}

Expand Down Expand Up @@ -134,7 +134,7 @@ func (c *ColumnInfo) IsGenerated() bool {
return len(c.GeneratedExprString) != 0
}

// SetOriginalDefaultValue sets the origin default value.
// SetOriginDefaultValue sets the origin default value.
// For mysql.TypeBit type, the default value storage format must be a string.
// Other value such as int must convert to string format first.
// The mysql.TypeBit type supports the null default value.
Expand All @@ -153,7 +153,7 @@ func (c *ColumnInfo) SetOriginDefaultValue(value interface{}) error {
return nil
}

// GetOriginalDefaultValue gets the origin default value.
// GetOriginDefaultValue gets the origin default value.
func (c *ColumnInfo) GetOriginDefaultValue() interface{} {
if c.Tp == mysql.TypeBit && c.OriginDefaultValueBit != nil {
// If the column type is BIT, both `OriginDefaultValue` and `DefaultValue` of ColumnInfo are corrupted,
Expand Down Expand Up @@ -220,7 +220,7 @@ func FindColumnInfo(cols []*ColumnInfo, name string) *ColumnInfo {
// for use of execution phase.
const ExtraHandleID = -1

// ExtraPartitionID is the column ID of column which store the partitionID decoded in global index values.
// ExtraPidColID is the column ID of column which store the partitionID decoded in global index values.
const ExtraPidColID = -2

const (
Expand Down Expand Up @@ -621,7 +621,7 @@ func (t *TableInfo) IsBaseTable() bool {
return t.Sequence == nil && t.View == nil
}

// ViewAlgorithm is VIEW's SQL AlGORITHM characteristic.
// ViewAlgorithm is VIEW's SQL ALGORITHM characteristic.
// See https://dev.mysql.com/doc/refman/5.7/en/view-algorithms.html
type ViewAlgorithm int

Expand Down
2 changes: 1 addition & 1 deletion model/model_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -152,7 +152,7 @@ func (*testModelSuite) TestJobStartTime(c *C) {
}
t := time.Unix(0, 0)
c.Assert(t, Equals, TSConvert2Time(job.StartTS))
c.Assert(job.String(), Equals, fmt.Sprintf("ID:123, Type:none, State:none, SchemaState:none, SchemaID:0, TableID:0, RowCount:0, ArgLen:0, start time: %s, Err:<nil>, ErrCount:0, SnapshotVersion:0", t))
c.Assert(job.String(), Equals, fmt.Sprintf("ID:123, Type:none, State:none, SchemaState:queueing, SchemaID:0, TableID:0, RowCount:0, ArgLen:0, start time: %s, Err:<nil>, ErrCount:0, SnapshotVersion:0", t))
}

func (*testModelSuite) TestJobCodec(c *C) {
Expand Down