Bug #74150 Remove tablespace_version
Submitted: 30 Sep 2014 8:58 Modified: 9 Oct 2014 19:03
Reporter: Marko Mäkelä Email Updates:
Status: Closed Impact on me:
None 
Category:MySQL Server: InnoDB storage engine Severity:S3 (Non-critical)
Version:5.7.5 OS:Any
Assigned to: CPU Architecture:Any

[30 Sep 2014 8:58] Marko Mäkelä
Description:
The field fil_space_t::tablespace_version was used for keeping track
of ALTER TABLE...DISCARD TABLESPACE followed by IMPORT TABLESPACE.

In WL#5522, which implements proper reassignment of tablespace_id on IMPORT,
the field became useless.

How to repeat:
See Description.

Suggested fix:
fil_space_create(): We will no longer assign tablespace_version.
This means that the caller must guarantee not to reassign the same space_id
during the server run.

Note that we are free to reuse a space_id after a server restart.
Any DDL recovery (which could involve dropping a tablespace)
would be executed in single-threaded mode, before accepting user
connections. No tablespaces should be created in the single-threaded mode.
  
Currently, some predefined tablespaces can be created in single-threaded mode.
The system tablespace and undo tablespaces are only created when creating
a new server instance.

Also, the temporary tablespace (ibtmp1) is created and assigned a new space_id
each time, but thanks to the logic in dict_hdr_get_new_id() there is no
possibility of collision on space_id with existing tablespaces.
[9 Oct 2014 19:03] Daniel Price
Fixed as of the upcoming 5.7.6 release, and here's the changelog entry:

Removed "fil_space_t::tablespace_version" field, which was introduced to
keep track of "ALTER TABLE...DISCARD TABLESPACE" followed by "ALTER TABLE
IMPORT TABLESPACE" operations. It ensured that a change buffer merge would
not occur for old buffered entries while a tablespace with the same
"space_id" was imported. The "tablespace_version" field was redundant and
no longer required.