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

PS-5223 : Can't upgrade with encrypted undo tablespaces from 5.7.24 to #3119

Merged

Conversation

robgolebiowski
Copy link
Contributor

8.0.13

This is a fix for upgrade from 5.7 encrypted undo tablespaces to PS
8.0.15. The fix is to accept encrypted undo tablespace header with
ENCRYPTION_KEY_MAGIC_V2 (instead of only ENCRYPTION_KEY_MAGIC_V3),
since PS 5.7 encrypted undo tablespaces are encrypted with
ENCRYPTION_KEY_MAGIC_V2.

Testcase percona_dd_upgrade_undo_encrypted was addded. It tests
upgrade with 5.7 encrypted undo tablespaces with:

  1. correct keyring and later upgrade
  2. empty keyring
  3. corrupted undo encryption keys

@robgolebiowski
Copy link
Contributor Author

storage/innobase/srv/srv0start.cc Outdated Show resolved Hide resolved
--copy_file $MYSQLTEST_VARDIR/std_data/undo57_encrypted.zip $MYSQL_TMP_DIR/undo57_encrypted.zip

--echo # Check that the file exists in the working folder.
--file_exists $MYSQL_TMP_DIR/undo57_encrypted.zip
Copy link
Contributor

Choose a reason for hiding this comment

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

Redundant, let either copy_file, either exec unzip fail


--source include/shutdown_mysqld.inc

--echo # Now lets test what happens when encryption key is missing and we try to start 8.0 server on 5.7 directory
Copy link
Contributor

Choose a reason for hiding this comment

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

Suggested change
--echo # Now lets test what happens when encryption key is missing and we try to start 8.0 server on 5.7 directory
--echo # Now let's test what happens when encryption key is missing and we try to start 8.0 server on 5.7 directory

--echo # Check that the file exists in the working folder.
--file_exists $MYSQL_TMP_DIR/undo57_encrypted.zip

--echo # Unzip the zip file.
Copy link
Contributor

Choose a reason for hiding this comment

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

Too obvious comment

Suggested change
--echo # Unzip the zip file.

--echo # Recreate the directories
--force-rmdir $MYSQL_TMP_DIR/undo57_encrypted
--echo # Check that the file exists in the working folder.
--file_exists $MYSQL_TMP_DIR/undo57_encrypted.zip
Copy link
Contributor

Choose a reason for hiding this comment

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

Remove

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 cannot remove the --force-rmdir part as there are some leftovers and server refuses to start:
2019-04-05T16:27:38.197914Z 1 [ERROR] [MY-012209] [InnoDB] Multiple files found for the same tablespace ID:
2019-04-05T16:27:38.197938Z 1 [ERROR] [MY-012202] [InnoDB] Tablespace ID: 15 = ['mysql/innodb_table_stats.ibd', 'mysql/innodb_table_stats_backup57.ibd']

2019-04-05T16:27:38.197955Z 1 [ERROR] [MY-012202] [InnoDB] Tablespace ID: 16 = ['mysql/innodb_index_stats.ibd', 'mysql/innodb_index_stats_backup57.ibd']

Copy link
Contributor

Choose a reason for hiding this comment

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

No remove not the force-rmdir but file_exists line

Copy link
Contributor Author

Choose a reason for hiding this comment

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

ack, this was done

--echo # Check that the file exists in the working folder.
--file_exists $MYSQL_TMP_DIR/undo57_encrypted.zip

--echo # Unzip the zip file.
Copy link
Contributor

Choose a reason for hiding this comment

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

Suggested change
--echo # Unzip the zip file.

@robgolebiowski robgolebiowski force-pushed the 8_0_PS-5223_upgrade_encrypted_undo branch from e9607b7 to d2cf60b Compare April 5, 2019 16:50
8.0.13

This is a fix for upgrade from 5.7 encrypted undo tablespaces to PS
8.0.15. The fix is to accept encrypted undo tablespace header with
ENCRYPTION_KEY_MAGIC_V2 (instead of only ENCRYPTION_KEY_MAGIC_V3),
since PS 5.7 encrypted undo tablespaces are encrypted with
ENCRYPTION_KEY_MAGIC_V2.

Testcase percona_dd_upgrade_undo_encrypted was addded. It tests
upgrade with 5.7 encrypted undo tablespaces with:
1) correct keyring and later upgrade
2) empty keyring
3) corrupted undo encryption keys
@robgolebiowski robgolebiowski force-pushed the 8_0_PS-5223_upgrade_encrypted_undo branch from d2cf60b to dfa6769 Compare April 8, 2019 07:12
@robgolebiowski
Copy link
Contributor Author

@robgolebiowski
Copy link
Contributor Author

@satya-bodapati @laurynas-biveinis @dutow ready for review

@robgolebiowski robgolebiowski merged commit 69713d1 into percona:8.0 Apr 10, 2019
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

4 participants