[MDEV-25312] Remove fil_space_t::name and related code Created: 2021-03-31  Updated: 2023-12-11  Resolved: 2021-04-08

Status: Closed
Project: MariaDB Server
Component/s: Storage Engine - InnoDB
Fix Version/s: 10.6.0

Type: Task Priority: Blocker
Reporter: Marko Mäkelä Assignee: Marko Mäkelä
Resolution: Fixed Votes: 0
Labels: performance

Issue Links:
Blocks
blocks MDEV-25180 Atomic ALTER TABLE Closed
is blocked by MDEV-12266 Reduce the number of InnoDB tablespac... Closed
Problem/Incident
causes MDEV-25524 AddressSanitizer: heap-use-after-free... Closed
Relates
relates to MDEV-30119 INFORMATION_SCHEMA.INNODB_TABLESPACES... Closed
relates to MDEV-32983 path separator near ib_buffer_pool in... Closed

 Description   

InnoDB allocates a tablespace name that is more or less a copy of the internal table name, and it does not use that for anything useful. There used to be a hash table of tablespace names (fil_system->name_hash), but it had been removed already in MDEV-12266 (10.3.6).

A consistency check for fil_space_t::name is causing recovery failures in MDEV-25180 (Atomic ALTER TABLE). So, we'd better remove that field altogether.



 Comments   
Comment by Marko Mäkelä [ 2021-04-07 ]

wlad, you suggested that it is OK to simplify code and use the forward slash on Microsoft Windows. So, as part of this simplification, we would remove os_normalize_path() and instead add some Windows-specific code that will treat some occurrences of the backslash in the same way as we would treat a forward slash.

This change will break compatibility on Microsoft Windows in two ways:

  1. A crash-upgrade from 10.5 to 10.6 might not work. But we do not really recommend to do it anyway.
  2. If someone specified a Microsoft Windows UNC (Universal Naming Convention) path for a DATA DIRECTORY or any of the InnoDB directory parameters, then things will likely fail.

Here is an example of what would start to fail (with double escaping, as needed in a .test file):

CREATE TABLE t(a INT) ENGINE=InnoDB
DATA DIRECTORY '\\\\\\\\?\\\\Volume{ae26d559-276d-11e6-80c1-000d3a3019c7}\\\\share\\\\';

Apparently, forward slashes are not allowed in path names that start with the characters that precede the string Volume. (Jira does not allow me to write the backslashes outside a code block.)

File names like E:/share/test/t.ibd or \\server\share/test/t.ibd will work just fine.

Comment by Vladislav Vaintroub [ 2021-04-07 ]

Looks fine

Generated at Thu Feb 08 09:36:45 UTC 2024 using Jira 8.20.16#820016-sha1:9d11dbea5f4be3d4cc21f03a88dd11d8c8687422.