pt-online-schema-change should not resume a job with empty boundaries

Description

Table data is lost if you accidentally resume a previously failed job that has null boundaries.

Run and stop the command multiple times: this will create multiple history entries with NULL in the new_table_name column:

 

Resume from correct job and stop: this will set new_table_name for all previous entries:

 

Resume a job with null boundaries:

Environment

None

AFFECTED CS IDs

CS0036893

Activity

Show:

Sveta Smirnova 4 days ago

The tool should fail if the boundaries are empty. I updated the error message so it is less confusing.

Aaditya Dubey July 22, 2024 at 10:28 AM
Edited

Hi

This issue is now verified and data is being lost when we run the pt-online-schema-change with job ID having null boundaries:

--no-drop-old-table is a saviour otherwise we lose the data completely so here in this case data can be recovered from old table or backup if available.

Aaditya Dubey July 12, 2024 at 1:11 PM

Hi Team,

We tried reproducing the error and were not able to get the same outcome:

Creating table data:

Running pt-osc and killing it in between:

We manually updated the table `percona.pt_osc_history` to set new_table_name=null

And retried pt-osc and were not able to reproduce the described behaviour:

Details

Assignee

Reporter

Priority

Affects versions

Fix versions

Needs QA

Yes

Smart Checklist

Created July 1, 2024 at 5:06 PM
Updated 4 days ago