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

executor: fix admin show ddl jobs end time bug when job is not finished #14738

Merged
merged 2 commits into from
Feb 12, 2020

Conversation

crazycs520
Copy link
Contributor

@crazycs520 crazycs520 commented Feb 12, 2020

Signed-off-by: crazycs crazycs520@gmail.com

What problem does this PR solve?

When DDL job doesn't finish, the END_TIME should be '' instead of 1970-01-01 08:00:00 +0800 CST.

Before this PR:

> admin show ddl jobs;
+--------+---------+------------+-----------+----------------------+-----------+----------+-----------+-----------------------------------+-----------------------------------+---------+
| JOB_ID | DB_NAME | TABLE_NAME | JOB_TYPE  | SCHEMA_STATE         | SCHEMA_ID | TABLE_ID | ROW_COUNT | START_TIME                        | END_TIME                          | STATE   |
+--------+---------+------------+-----------+----------------------+-----------+----------+-----------+-----------------------------------+-----------------------------------+---------+
| 57     | test    | t          | add index | write reorganization | 1         | 51       | 0         | 2020-02-12 11:07:01.817 +0800 CST | 1970-01-01 08:00:00 +0800 CST     | running |
| 58     | test    | t          | add index | none                 | 1         | 51       | 0         | 2020-02-12 11:07:02.972 +0800 CST | 1970-01-01 08:00:00 +0800 CST     | none    |
+--------+---------+------------+-----------+----------------------+-----------+----------+-----------+-----------------------------------+-----------------------------------+---------+

This PR:

+--------+---------+------------+-----------+--------------+-----------+----------+-----------+-----------------------------------+-----------------------------------+---------+
| JOB_ID | DB_NAME | TABLE_NAME | JOB_TYPE  | SCHEMA_STATE | SCHEMA_ID | TABLE_ID | ROW_COUNT | START_TIME                        | END_TIME                          | STATE   |
+--------+---------+------------+-----------+--------------+-----------+----------+-----------+-----------------------------------+-----------------------------------+---------+
| 59     | test    | t          | add index | delete only  | 1         | 51       | 0         | 2020-02-12 11:08:48.919 +0800 CST |                                   | running |
| 60     | test    | t          | add index | none         | 1         | 51       | 0         | 2020-02-12 11:08:49.919 +0800 CST |                                   | none    |
+--------+---------+------------+-----------+--------------+-----------+----------+-----------+-----------------------------------+-----------------------------------+---------+

What is changed and how it works?

Check List

Tests

  • Unit test
  • Manual test

Code changes

  • Has exported function/method change

Side effects

  • Possible performance regression
  • Increased code complexity
  • Breaking backward compatibility

Related changes

  • Need to cherry-pick to the release branch

Release note

  • Fix the END_TIME of admin show ddl jobs bug, when the DDL job not finish, the END_TIME should be "".

@crazycs520 crazycs520 added the type/bugfix This PR fixes a bug. label Feb 12, 2020
Copy link
Contributor

@tangenta tangenta left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM

@tangenta tangenta added sig/execution SIG execution status/LGT1 Indicates that a PR has LGTM 1. labels Feb 12, 2020
Copy link
Contributor

@zimulala zimulala left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM

@zimulala zimulala added status/can-merge Indicates a PR has been approved by a committer. and removed status/LGT1 Indicates that a PR has LGTM 1. labels Feb 12, 2020
@sre-bot
Copy link
Contributor

sre-bot commented Feb 12, 2020

/run-all-tests

@sre-bot sre-bot merged commit be434ba into pingcap:master Feb 12, 2020
Copy link
Member

@bb7133 bb7133 left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM

@bb7133 bb7133 added this to the v4.0.0-beta.1 milestone Feb 12, 2020
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
sig/execution SIG execution status/can-merge Indicates a PR has been approved by a committer. type/bugfix This PR fixes a bug.
Projects
None yet
Development

Successfully merging this pull request may close these issues.

5 participants