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

ttl job's start time will be override by mistake after failover #44767

Closed
Tracked by #39262
lcwangchao opened this issue Jun 19, 2023 · 0 comments · Fixed by #44768
Closed
Tracked by #39262

ttl job's start time will be override by mistake after failover #44767

lcwangchao opened this issue Jun 19, 2023 · 0 comments · Fixed by #44768
Labels
affects-6.5 This bug affects the 6.5.x(LTS) versions. affects-7.1 This bug affects the 7.1.x(LTS) versions. severity/major sig/sql-infra SIG: SQL Infra type/bug The issue is confirmed as a bug.

Comments

@lcwangchao
Copy link
Collaborator

Bug Report

Please answer these questions before submitting your issue. Thanks!

1. Minimal reproduce step (Required)

  1. create a TTL table
 create table t1(t timestamp default current_timestamp) TTL=`t`+interval 1 MINUTE ttl_job_interval='1h';
  1. whe job running, check the table status:
> select * from mysql.tidb_ttl_table_status\G
***************************[ 1. row ]***************************
table_id                       | 106
parent_table_id                | 106
table_statistics               | <null>
last_job_id                    | <null>
last_job_start_time            | <null>
last_job_finish_time           | <null>
last_job_ttl_expire            | <null>
last_job_summary               | <null>
current_job_id                 | 1027d8d0-ac77-4ef6-88d1-b3d481457aed
current_job_owner_id           | 78928a9a-c379-4c22-921f-2994ada99057
current_job_owner_addr         | <null>
current_job_owner_hb_time      | 2023-06-19 11:59:25
current_job_start_time         | 2023-06-19 11:58:52
current_job_ttl_expire         | 2023-06-19 11:57:51
current_job_state              | <null>
current_job_status             | running
current_job_status_update_time | 2023-06-19 11:59:25
  1. kill the running tidb and restart a new one. Then the new tidb will take over the job, and then check the table status again:
> select * from mysql.tidb_ttl_table_status\G
***************************[ 1. row ]***************************
table_id                       | 106
parent_table_id                | 106
table_statistics               | <null>
last_job_id                    | <null>
last_job_start_time            | <null>
last_job_finish_time           | <null>
last_job_ttl_expire            | <null>
last_job_summary               | <null>
current_job_id                 | 1027d8d0-ac77-4ef6-88d1-b3d481457aed
current_job_owner_id           | 531cb4c2-4b3f-49e6-85d8-fb1ef46e181f
current_job_owner_addr         | <null>
current_job_owner_hb_time      | 2023-06-19 12:01:34
current_job_start_time         | 2023-06-19 12:01:34
current_job_ttl_expire         | 2023-06-19 11:57:51
current_job_state              | <null>
current_job_status             | running
current_job_status_update_time | 2023-06-19 12:01:34
1 row in set
Time: 0.002s

Notice that the current_job_start_time is override with a new value.

2. What did you expect to see? (Required)

current_job_start_time should not be changed for a same job

3. What did you see instead (Required)

current_job_start_time changed

4. What is your TiDB version? (Required)

master

@lcwangchao lcwangchao added type/bug The issue is confirmed as a bug. severity/major labels Jun 19, 2023
@ti-chi-bot ti-chi-bot bot added may-affects-5.1 This bug maybe affects 5.1.x versions. may-affects-5.2 This bug maybe affects 5.2.x versions. may-affects-5.3 This bug maybe affects 5.3.x versions. may-affects-5.4 This bug maybe affects 5.4.x versions. may-affects-6.1 may-affects-6.5 may-affects-7.1 labels Jun 19, 2023
@lcwangchao lcwangchao added affects-6.5 This bug affects the 6.5.x(LTS) versions. affects-7.1 This bug affects the 7.1.x(LTS) versions. and removed may-affects-5.1 This bug maybe affects 5.1.x versions. may-affects-5.2 This bug maybe affects 5.2.x versions. may-affects-5.3 This bug maybe affects 5.3.x versions. may-affects-5.4 This bug maybe affects 5.4.x versions. may-affects-6.1 may-affects-6.5 may-affects-7.1 labels Jun 19, 2023
@jebter jebter added the sig/sql-infra SIG: SQL Infra label Aug 4, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
affects-6.5 This bug affects the 6.5.x(LTS) versions. affects-7.1 This bug affects the 7.1.x(LTS) versions. severity/major sig/sql-infra SIG: SQL Infra type/bug The issue is confirmed as a bug.
Projects
None yet
Development

Successfully merging a pull request may close this issue.

2 participants