[MDEV-27065] Partitioning tables with custom data directories moves data back to default directory Created: 2021-11-16 Updated: 2022-10-31 Resolved: 2022-04-08 |
|
| Status: | Closed |
| Project: | MariaDB Server |
| Component/s: | Data Definition - Alter Table, Partitioning |
| Affects Version/s: | 10.4.22, 10.5.13, 10.6.5, 10.2, 10.3, 10.7, 10.8 |
| Fix Version/s: | 10.2.44, 10.3.35, 10.4.25, 10.5.16, 10.6.8, 10.7.4, 10.8.3 |
| Type: | Bug | Priority: | Critical |
| Reporter: | Juan | Assignee: | Nayuta Yanagisawa (Inactive) |
| Resolution: | Fixed | Votes: | 1 |
| Labels: | None | ||
| Environment: |
CentOS 7.7 |
||
| Issue Links: |
|
||||||||
| Description |
|
Partitioning tables ignores specified data directory and moves tables back to default data directory. This has serious consequences when there is a larger alternate mount bigger partitioned tables and not enough space to hold that data in the default data directory. When tables are created with an individually specified data directory different from the default, this definition is lost during partitioning, and the engine re-creates the table back in the default data directory. Alter table operations allow the specification of a data directory with partitioning commands, but ignore the specified directory, showing a warning. Other alter table operations, such as adding a column, do not have this problem.
|
| Comments |
| Comment by Nayuta Yanagisawa (Inactive) [ 2022-03-16 ] |
|
The data directory cannot be specified by the table option when the table is partitioned.
https://mariadb.com/kb/en/create-table/#data-directoryindex-directory |
| Comment by Nayuta Yanagisawa (Inactive) [ 2022-03-29 ] |
|
An ALTER TABLE of a non-partitioned table at least returns a warning. Thus, I will give a few more thoughts on the issue. |
| Comment by Nayuta Yanagisawa (Inactive) [ 2022-03-29 ] |
|
ralf.gebhardt@mariadb.com (cc: serg) If we raise the warning on the case in the issue description, we need to raise the warning even when a user does not specify DATA DIRECTORY intentionally. That is because we cannot distinguish the case where he forgets to specify DATA DIRECTORY at some partitions and the case where he intentionally does not specify DATA DIRECTORY. Do you think it is acceptable? |
| Comment by Nayuta Yanagisawa (Inactive) [ 2022-03-29 ] |
|
Naive implementation for reference https://github.com/MariaDB/server/commit/a10facb656b55b483fe8a6638253b73d6c51666c |
| Comment by Sergei Golubchik [ 2022-03-29 ] |
| Comment by Nayuta Yanagisawa (Inactive) [ 2022-03-30 ] |
|
Yes, the error message of the above implementation is confusing (thus I described it as "naive"). I will improve the message. |
| Comment by Nayuta Yanagisawa (Inactive) [ 2022-03-30 ] |
|
https://github.com/MariaDB/server/commit/b1986e31617d0219e9dea1dfe36acdacdcabfbae |
| Comment by Nayuta Yanagisawa (Inactive) [ 2022-03-31 ] |
|
holyfoot Please review the following: https://github.com/MariaDB/server/commit/0907c3e4254af13870e010e20ff1cdb56b7f14df |
| Comment by Alexey Botchkov [ 2022-04-08 ] |
|
ok to push. |