pt-online-schema-change can loose data if the charset do not match

Description

hi.

this is a bug report for pt-osc, see below for explanation of the issue.

suggested fixes are:

  • pt-osc check charset of table and columns and error immediately if config/arguments will use incompatible charset that will result in data loss.

  • pt-osc check count of rows in table and _table_new to ensure they match before swapping (ideally also compare checksum of columns in common, e.g. via pt-table-checksum method).

  • pt-osc error immediately if a nibble found no rows when the query to determine the upper boundary immediately prior ensures that the rows do exist.

 

 

Environment

None

AFFECTED CS IDs

276052

Smart Checklist

Activity

Sveta Smirnova June 13, 2020 at 7:47 AM
Edited

Than you for the report.

Verified as described.

Indeed, pt-online-schema-change can corrupt data if it's default character set does not match character set for the key it uses to chunk rows in the table.

Workaround: use option --charset

Sveta Smirnova June 13, 2020 at 7:46 AM

How to repeat:

Details

Assignee

Reporter

Priority

Affects versions

Smart Checklist

Created June 12, 2020 at 7:51 PM
Updated February 29, 2024 at 8:58 PM