Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Fix bug 1548597 / 76142 (InnoDB tablespace import fails when importin… #615

Merged
merged 1 commit into from Jun 24, 2016

Conversation

laurynas-biveinis
Copy link
Contributor

…g table w/ different data directory)

Importing a transportable tablespace will fail if its table definition
has data directory specified while the donor table did not have one,
and vice versa. Fix by relaxing the checks in fil_node_open_file() and
row_import::match_schema() to allow this particular mismatch while
still requiring that the rest of the flags match. Do not actually
patch the tablespace header with the new flag value as InnoDB is
already making assumptions elsewhere that the data directory flag bits
may mismatch. Also fix tablespace import diagnostics that in the case
of flags mismatch printed number of columns, not flags. Add a
testcase.

http://jenkins.percona.com/job/percona-server-5.6-param/1189/

@laurynas-biveinis
Copy link
Contributor Author

@kbauskar, if you happen to be familiar with transportable tablespaces, your second opinion would be very appreciated. Specifically, this fix makes no attempt to re-write imported tablespace flags with the actual data directory flag value, but leaves it mismatched as-is. Based on my understanding of code (see fil_open_single_file_tablespace), this is correct design, but maybe I understood it wrong.

--echo #

--let $MYSQLD_DATADIR = `SELECT @@datadir`

Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Add

--let $CURRENT_DB = SELECT DATABASE()

and then use ".../$CURRENT_DB/..." in --copy-file / --move_file paths instead of ".../test/..."

@percona-ysorokin
Copy link
Collaborator

LGTM with minor MTR test comments


if (m_flags != m_table->flags) {
if (relevant_flags != relevant_table_flags) {
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I would expect a warning if flag mis-match on data-dir part so that user know we incompatibility we are trying allowing.

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I am not sure - because the user has no means of actually fixing this warning short of hex editor. A warning that's unfixable would be error log spam

@kbauskar
Copy link
Contributor

LGTM.
I don't see any technical flaw as we are ignore flag during important and tablespace open.
I would propose we warn user about it though.

I am not sure what motivated this but may be it would create issues with 5.8 once all this information is moved to data-dictionary. Can be ignore for now though.

@laurynas-biveinis
Copy link
Contributor Author

Please see my inline comment re. warning. As for 5.8, we would adjust the fix as needed during the porting process.

@kbauskar
Copy link
Contributor

LGTM.

…g table w/ different data directory)

Importing a transportable tablespace will fail if its table definition
has data directory specified while the donor table did not have one,
and vice versa. Fix by relaxing the checks in fil_node_open_file() and
row_import::match_schema() to allow this particular mismatch while
still requiring that the rest of the flags match. Do not actually
patch the tablespace header with the new flag value as InnoDB is
already making assumptions elsewhere that the data directory flag bits
may mismatch. Also fix tablespace import diagnostics that in the case
of flags mismatch printed number of columns, not flags. Add a
testcase.
@laurynas-biveinis
Copy link
Contributor Author

@laurynas-biveinis laurynas-biveinis merged commit 9e9ff97 into percona:5.6 Jun 24, 2016
@laurynas-biveinis laurynas-biveinis deleted the bug1548597-5.6 branch June 24, 2016 04:14
inikep pushed a commit to inikep/percona-server that referenced this pull request Apr 23, 2020
Summary:
If table definition (frm) has changed during myrocks_hotbackup,
destination instance may get inconsistent -- having new frm file,
but MyRocks sst files are based on snapshots, and their data might be
older -- based on old frm file. To prevent such inconsistencies,
myrocks_hotbackup checks frm file midification timestamp, and
aborts if it is newer than backup starting time.
Closes facebook/mysql-5.6#615

Test Plan: xbstream.test

Differential Revision: D4946487

Pulled By: yoshinorim

fbshipit-source-id: 572a9cc025e
inikep pushed a commit to inikep/percona-server that referenced this pull request Feb 24, 2021
Summary:
If table definition (frm) has changed during myrocks_hotbackup,
destination instance may get inconsistent -- having new frm file,
but MyRocks sst files are based on snapshots, and their data might be
older -- based on old frm file. To prevent such inconsistencies,
myrocks_hotbackup checks frm file midification timestamp, and
aborts if it is newer than backup starting time.
Closes facebook/mysql-5.6#615

Test Plan: xbstream.test

Differential Revision: D4946487

Pulled By: yoshinorim

fbshipit-source-id: 572a9cc025e
inikep pushed a commit to inikep/percona-server that referenced this pull request Nov 15, 2021
…#615)

Summary:
If table definition (frm) has changed during myrocks_hotbackup,
destination instance may get inconsistent -- having new frm file,
but MyRocks sst files are based on snapshots, and their data might be
older -- based on old frm file. To prevent such inconsistencies,
myrocks_hotbackup checks frm file midification timestamp, and
aborts if it is newer than backup starting time.
Closes facebook/mysql-5.6#615

Differential Revision: D4946487 (facebook/mysql-5.6@f5f79fe)

Pulled By: yoshinorim

fbshipit-source-id: 1c789be62e0
ldonoso pushed a commit to ldonoso/percona-server that referenced this pull request Mar 15, 2022
…#615)

Summary:
If table definition (frm) has changed during myrocks_hotbackup,
destination instance may get inconsistent -- having new frm file,
but MyRocks sst files are based on snapshots, and their data might be
older -- based on old frm file. To prevent such inconsistencies,
myrocks_hotbackup checks frm file midification timestamp, and
aborts if it is newer than backup starting time.
Closes facebook/mysql-5.6#615

Differential Revision: D4946487

Pulled By: yoshinorim
inikep pushed a commit to inikep/percona-server that referenced this pull request Apr 9, 2024
…#615)

Summary:
If table definition (frm) has changed during myrocks_hotbackup,
destination instance may get inconsistent -- having new frm file,
but MyRocks sst files are based on snapshots, and their data might be
older -- based on old frm file. To prevent such inconsistencies,
myrocks_hotbackup checks frm file midification timestamp, and
aborts if it is newer than backup starting time.
Closes facebook/mysql-5.6#615

Differential Revision: D4946487

Pulled By: yoshinorim
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
3 participants