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 #1651657, failback from backup for legacy for small BP instance size - 5.7 #1263

Merged
merged 2 commits into from Mar 31, 2017

Conversation

ihanick
Copy link
Contributor

@ihanick ihanick commented Dec 25, 2016

http://jenkins.percona.com/view/5.7/job/mysql-5.7-param/561/
https://bugs.launchpad.net/percona-server/+bug/1651657
#1262 PR 5.6

If buffer pool is bigger than 1GB and there are many buffer pool instances each instance could be smaller than 20MB and causing deadlocks with backoff algorithm.

Copy link
Contributor

@laurynas-biveinis laurynas-biveinis left a comment

Choose a reason for hiding this comment

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

In addition to 5.6 comments, a 5.7-specific question: - what happens if we have "backoff" set with a large enough buffer pool and then resize it down so that it needs "legacy"?

@ihanick ihanick force-pushed the 5.7-ps-bug1651657 branch 2 times, most recently from c5a33ba to 8103a23 Compare March 21, 2017 12:53
@ihanick
Copy link
Contributor Author

ihanick commented Mar 21, 2017

http://jenkins.percona.com/view/5.7/job/mysql-5.7-param/738/

  • merged 5.6 changes
  • preventing from reducing innodb_buffer_pool size if backoff is enabled and resulting buffer pool instance size will be less than 20MB
  • using 20MB buffer pool change in innodb_buffer_pool_size_basic to keep test case compatible with backoff

@laurynas-biveinis
Copy link
Contributor

The added test is failing intermittently:

innodb.percona_bug1651657 w3 [ fail ]
Test ended at 2017-03-21 10:19:31

CURRENT_TEST: innodb.percona_bug1651657
--- /mnt/workspace/mysql-5.7-param/BUILD_TYPE/debug/Host/centos6-32/mysql-test/suite/innodb/r/percona_bug1651657.result 2017-03-21 12:25:46.228520091 +0300
+++ /mnt/workspace/mysql-5.7-param/BUILD_TYPE/debug/Host/centos6-32/build/mysql-test/var/3/log/percona_bug1651657.reject 2017-03-21 17:19:31.481432098 +0300
@@ -4,6 +4,9 @@
ERROR 42000: Variable 'innodb_empty_free_list_algorithm' can't be set to the value of 'backoff'
include/assert.inc [Small buffer pool instances should use legacy]
SET @@GLOBAL.innodb_buffer_pool_size = 1189085184;
+Timeout in wait_condition.inc for SELECT SUBSTR(variable_value, 1, 34) = 'Completed resizing buffer pool at '

  • FROM information_schema.global_status
    +WHERE LOWER(variable_name) = 'innodb_buffer_pool_resize_status'
    SET GLOBAL innodb_empty_free_list_algorithm="backoff";
    SET @@GLOBAL.innodb_buffer_pool_size = 1075838976;
    ERROR 42000: Variable 'innodb_buffer_pool_size' can't be set to the value of '1075838976'

--source include/assert.inc

call mtr.add_suppression("InnoDB: innodb_empty_free_list_algorithm = 'backoff' requires at least 20MB buffer pool instances.");
--error 1231
Copy link
Contributor

Choose a reason for hiding this comment

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

Please use ER_ mnemonics

bool
innodb_empty_free_list_algorithm_allowed(
srv_empty_free_list_t algorithm,
ulint new_buf_pool_sz = 0)
Copy link
Contributor

Choose a reason for hiding this comment

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

long long arg? It's getting called from a "long long" MySQL variable validation function

@param[in] algorithm desired algorithm from srv_empty_free_list_t
@param[in] new_buf_pool_sz requested buffer pool size
@return true if it's possible to enable backoff. */
static inline
Copy link
Contributor

Choose a reason for hiding this comment

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

Just static

"because of small buffer pool size. "
"In order to use backoff, "
"increase buffer pool at least up to 20MB.\n");
srv_empty_free_list_algorithm
Copy link
Contributor

Choose a reason for hiding this comment

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

Indentation

@ihanick ihanick force-pushed the 5.7-ps-bug1651657 branch 5 times, most recently from 16c79f5 to a4f31d4 Compare March 28, 2017 10:23
@ihanick
Copy link
Contributor Author

ihanick commented Mar 28, 2017

http://jenkins.percona.com/job/mysql-5.7-param/756/

  • using ER_WRONG_VALUE_FOR_VAR

  • removed inline

  • using long long for innodb_empty_free_list_algorithm_allowed buffer pool size parameter

  • fixed ident for srv_empty_free_list_algorithm

  • removed buffer pool change (from 1GB to 1080MB), small instances (centos6-32bit) getting out of memory errors (mmap returns errno 12).

I'm getting warnings with 19MB buffer pool instance (1026 buffer pool size, 54 instances) even with legacy flush algorithm:

14:17:44 2017-03-28T14:17:36.086635Z 8 [Warning] InnoDB: Difficult to find free blocks in the buffer pool (338 search iterations)! 0 failed attempts to flush a page! Consider increasing the buffer pool size. It is also possible that in your Unix version fsync is very slow, or completely frozen inside the OS kernel. Then upgrading to a newer version of your operating system may help. Look at the number of fsyncs in diagnostic info below. Pending flushes (fsync) log: 0; buffer pool: 0. 17861 OS file reads, 29281 OS file writes, 8 OS fsyncs. Starting InnoDB Monitor to print further diagnostics to the standard output.

http://jenkins.percona.com/job/mysql-5.7-param/756/BUILD_TYPE=debug,Host=centos6-32/consoleFull

Thus for 5.7 it could be a good idea to limit buffer pool instance size at 20MB+ and remove backoff to legacy failback (current tests are executed with at least 128MB buffer pool instances if multiple buffer pool instances are enabled in 5.7).

Copy link
Contributor

@laurynas-biveinis laurynas-biveinis left a comment

Choose a reason for hiding this comment

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

Please restore the bp resize test, it is important and tests an affected code path. In order for the testcase to be lighter on our Jenkins, please reduce the instance count, it could be as small as 2.

Limitting minimum buffer pool size is not desirable as there are users running application tests with minimally-sized MySQL instances

buffer pool belongs to LRU or freelist.
At the same time buf_flush_LRU_list_batch
keeps up to BUF_LRU_MIN_LEN in LRU.
In order to avoid deadlock baclkoff requires buffer pool
Copy link
Contributor

Choose a reason for hiding this comment

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

"backoff"

@ihanick
Copy link
Contributor Author

ihanick commented Mar 29, 2017

http://jenkins.percona.com/job/mysql-5.7-param/764/
made a split:

  • one test case to test multiple buffer pools and fallback to legacy. Multiple buffer pools are allowed in 5.7 if innodb_buffer_pool_size > 1G, minimal number of buffer pool instances to cause fallback: 1026M/19M = 54.

  • second test case handles buffer pool resize from 20MB to 19MB (with one instance) - resize disallowed if algorithm is backoff, no actual buffer pool resize happening

  • fixed a typo in comment

@@ -0,0 +1,13 @@
--source include/have_innodb.inc
Copy link
Contributor

Choose a reason for hiding this comment

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

Please add --source include/big_test.inc


set @old_innodb_buffer_pool_size = @@innodb_buffer_pool_size;

# Test buffer pool shink with backoff algorithm.
Copy link
Contributor

Choose a reason for hiding this comment

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

"shrink"

@ihanick
Copy link
Contributor Author

ihanick commented Mar 30, 2017

http://jenkins.percona.com/view/5.7/job/mysql-5.7-param/767/

  • added big for 1GB BP test
  • fixed typo in test comment

@ihanick ihanick merged commit 2574fba into percona:5.7 Mar 31, 2017
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
2 participants