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-5541: Do not try to decrypt blocks in changed page tracking. (5.7) #3150

Merged
merged 1 commit into from
May 8, 2019

Conversation

dutow
Copy link
Contributor

@dutow dutow commented Apr 17, 2019

Issue: changed page tracking uses the LOG flag during read
operations to follow the correct code path. Redo log encryption
backported from 8.0 tries to decrypt pages with a certain bit set,
and fails. While the end result is the same, the error log gets
flooded with decryption errors.

Solution: the NO_ENCRYPTION flag, previously ignored by log
encryption now disables decryption during log reads too.

@dutow dutow changed the title PS-5541: Do not try to decrypt blocks in changed page tracking. PS-5541: Do not try to decrypt blocks in changed page tracking. (5.7) Apr 17, 2019
@@ -0,0 +1,47 @@
-- source include/big_test.inc
Copy link
Contributor

Choose a reason for hiding this comment

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

If I understand correctly, the test does not require redo log encryption itself to be enabled, correct? In which case this scenario should be test by existing innodb.percona_changed* testcases, please check, whether the new testcase is required at all

Copy link
Contributor Author

Choose a reason for hiding this comment

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

That's right, encryption is not needed - but a huge amount of data is. If I insert fewer records than what we have in this test case, the issue won't show up without this commit. And with this amount, it runs for 15-20 minutes on a debug build.

Copy link
Contributor

@laurynas-biveinis laurynas-biveinis Apr 18, 2019

Choose a reason for hiding this comment

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

OK, then the existing bitmap testcases have predetermined name prefix (percona_changed_page_bmp in general, percona_changes_pages for I_S queries like this one), so please rename to percona_changed_pages_big and add a header comment --echo # / --echo # PS-5541: blah blah / --echo #

@@ -0,0 +1,47 @@
-- source include/big_test.inc
Copy link
Contributor

@laurynas-biveinis laurynas-biveinis Apr 18, 2019

Choose a reason for hiding this comment

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

OK, then the existing bitmap testcases have predetermined name prefix (percona_changed_page_bmp in general, percona_changes_pages for I_S queries like this one), so please rename to percona_changed_pages_big and add a header comment --echo # / --echo # PS-5541: blah blah / --echo #

show status like 'Innodb_page%';
--enable_result_log

USE test;
Copy link
Contributor

Choose a reason for hiding this comment

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

Redundant

-- source include/big_test.inc

--disable_result_log
show status like 'Innodb_page%';
Copy link
Contributor

Choose a reason for hiding this comment

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

Why?

@@ -0,0 +1,47 @@
-- source include/big_test.inc

Copy link
Contributor

Choose a reason for hiding this comment

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

--source include/have_innodb.inc

`g` int(11) NOT NULL,
PRIMARY KEY (`i`),
KEY key_g (`g`)
) ENGINE=InnoDB DEFAULT CHARSET=latin1;
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
) ENGINE=InnoDB DEFAULT CHARSET=latin1;
) ENGINE=InnoDB DEFAULT CHARSET=latin1;

KEY key_g (`g`)
) ENGINE=InnoDB DEFAULT CHARSET=latin1;

INSERT INTO joinit VALUES (NULL, uuid(), time(now()), (FLOOR( 1 + RAND( ) *60 )));
Copy link
Contributor

Choose a reason for hiding this comment

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

Everywhere

Suggested change
INSERT INTO joinit VALUES (NULL, uuid(), time(now()), (FLOOR( 1 + RAND( ) *60 )));
INSERT INTO joinit VALUES (NULL, uuid(), time(now()), (FLOOR(1 + RAND() * 60)));

INSERT INTO joinit SELECT NULL, uuid(), time(now()), (FLOOR( 1 + RAND( ) *60 )) FROM joinit;

--disable_result_log
show status like 'Innodb_page%';
Copy link
Contributor

Choose a reason for hiding this comment

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

Why?

@@ -0,0 +1,2 @@
--innodb_track_changed_pages=1 --innodb_max_bitmap_file_size=1G --innodb_buffer_pool_size=1G
Copy link
Contributor

Choose a reason for hiding this comment

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

Is 1G buffer pool size necessary?

KEY key_g (`g`)
) ENGINE=InnoDB DEFAULT CHARSET=latin1;

INSERT INTO joinit VALUES (NULL, uuid(), time(now()), FLOOR(1 + RAND() *60 ));
Copy link
Contributor

Choose a reason for hiding this comment

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

Comment not addressed

INSERT INTO joinit SELECT NULL, uuid(), time(now()), FLOOR(1 + RAND() *60) FROM joinit;

--disable_result_log
select count(*) as count_innodb_changed_pages from information_schema.INNODB_CHANGED_PAGES;
Copy link
Contributor

Choose a reason for hiding this comment

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

Make SQL case consistent

KEY key_g (`g`)
) ENGINE=InnoDB DEFAULT CHARSET=latin1;

INSERT INTO joinit VALUES (NULL, uuid(), time(now()), FLOOR(1 + RAND() * 60));
Copy link
Contributor

Choose a reason for hiding this comment

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

Strictly speaking

Suggested change
INSERT INTO joinit VALUES (NULL, uuid(), time(now()), FLOOR(1 + RAND() * 60));
INSERT INTO joinit VALUES (NULL, uuid(), time(now()), FLOOR(1 + RAND() * 60));

still not done but of course not enough to cause a PR respin by itself

Issue: changed page tracking uses the LOG flag during read
operations to follow the correct code path. Redo log encryption
backported from 8.0 tries to decrypt pages with a certain bit set,
and fails. While the end result is the same, the error log gets
flooded with decryption errors.

Solution: the NO_ENCRYPTION flag, previously ignored by log
encryption now disables decryption during log reads too.
@dutow dutow force-pushed the ps-5.7-ps5541 branch from 198ce42 to eda1eac Compare May 7, 2019 13:29
@dutow dutow merged commit f91a9f2 into percona:5.7 May 8, 2019
@dutow dutow deleted the ps-5.7-ps5541 branch May 8, 2019 15:43
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.

2 participants