[MDEV-7628] Row-based replication of old DECIMAL to new DECIMAL Created: 2015-02-25 Updated: 2022-09-08 |
|
| Status: | Stalled |
| Project: | MariaDB Server |
| Component/s: | Replication |
| Fix Version/s: | 10.1 |
| Type: | Task | Priority: | Major |
| Reporter: | Alexander Barkov | Assignee: | Andrei Elkin |
| Resolution: | Unresolved | Votes: | 1 |
| Labels: | None | ||
| Issue Links: |
|
||||||||||||
| Sprint: | 10.0.20 | ||||||||||||
| Description |
|
There was a discussion on maria-developers@ in December 2014 to February 2015 about how to solve the problem with RBR replication of the old DECIMAL. See This is a super-task to solve most of the problems. I. The ideas that most participants agreed on:1. Make "ALTER TABLE t1 FORCE" fully rebuild the table and change old DECIMAL to new DECIMALTarget version: 10.0 This change will give DBA a way to upgrade desired tables manually. This will not touch old DECIMAL(M,N) that do not fit into the new DECIMAL, i.e. those with M>65 and/or N>30, e.g. DECIMAL(200,30). The old DECIMAL column will still require an explicit manual:
2. Add warnings about the old DECIMAL into mysql_upgrade outputTarget version: 10.0 This change will give DBA a way to know about the old DECIMAL columns at upgrade time. We'll keep "CHECK TABLE t1 FOR UPGRADE" to still return a line with Msg_type=status and Msg_text=OK, but also add new lines with Msg_type=note and Msg_text telling something like:
mysql_upgrade will NOT upgrade tables with the old DECIMAL automatically, because they will still be reported as "OK". But mysql_upgrade will detect and print the new notes from the "CHECK TABLE t1 FOR UPGRADE" output. 3. DONE: Make INFORMATION_SCHEMA.COLUMNS somehow print information about the deprecated data typesThis change was done in 5.5.44 by: Target version: 10.0 or even 5.5 Daniel B. wrote:
Possible columns that can be used for this purpose:
Sergei thinks that using COLUMN_TYPE for this purpose as a bad idea, but DATA_TYPE or EXTRA should be fine:
Bar thinks that DATA_TYPE_ID will be needed soon for the pluggable data types anyway, so votes for DATA_TYPE_ID. It should be safe to add DATA_TYPE_ID into 10.0 or even 5.5. 4. Make the slave with the new DECIMAL assume that the old DECIMAL on the master has the same scale and precision.Target version: 10.0 or 10.1 This idea was proposed by Davi A. and Kristian N.: Davi A. wrote:
Kristian N. wrote:
5. Make mysql_upgrade change the old DECIMAL to the new DECIMAL automaticallyTarget version: 10.2 Change "b" to return Msg_type=error and Mst_text="Table upgrade required. Please do "REPAIR TABLE `tablename`" or dump/reload to fix it!" This will also force mysql_upgrade to rebuild tables with the old DECIMAL automatically. Kristian N. wrote:
II. The ideas that were rejected during the discussion:1. Refuse binary logging for the old DECIMALThere was an idea to make the master running with --binlog-format=row refuse any INSERT/UPDATE/ALTER or any other queries that can modify a table with the old DECIMAL, as well as create old DECIMAL columns:
But, as Jeremy C. and Sergei G. noticed, this will break replication when both master and slave use old DECIMAL columns of exactly the same precision and scale. Currently RBR replication works without any problems in this scenario, and we should not break this. So will not go this way. 2. Extend binary log to write metadata for the old DECIMALThere was an idea to introduce a new row event, or a new type code (e.g. MYSQL_TYPE_OLD_DECIMAL_WITH_METADATA). But perhaps this would be too much efforts for a deprecated data type. This change is currently not planned for any releases. |
| Comments |
| Comment by Sergei Golubchik [ 2015-06-11 ] |
|