summaryrefslogtreecommitdiff
path: root/storage
diff options
context:
space:
mode:
authorThirunarayanan Balathandayuthapani <thirunarayanan.balathandayuth@oracle.com>2015-03-24 14:09:18 +0530
committerThirunarayanan Balathandayuthapani <thirunarayanan.balathandayuth@oracle.com>2015-03-24 14:09:18 +0530
commitf8eacccf2a56e86ed5c6413481d5ea918b9eca1d (patch)
treef7dba1b06defacd4e0840cf25d3e5d51579b487d /storage
parent26e845c19d5387a13cf30c9bd6c58e9e819fb2b2 (diff)
downloadmariadb-git-f8eacccf2a56e86ed5c6413481d5ea918b9eca1d.tar.gz
Bug#20422680 BUF_POOL_WATCH_SET WOULD CRASH TRYING
TO USE A SECOND WATCH PAGE PER INSTANCE Description: BUF_POOL_WATCH_SIZE is also initialized to number of purge threads. so BUF_POOL_WATCH_SIZE will never be lesser than number of purge threads. From the code, there is no scope for purge thread to skip buf_pool_watch_unset. So there can be at most one buffer pool watch active per purge thread. In other words, there is no chance for purge thread instance to hold a watch when setting another watch. Solution: Adding code comments to clarify the issue. Reviewed-by: Marko Mäkelä <marko.makela@oracle.com> Approved via Bug page.
Diffstat (limited to 'storage')
-rw-r--r--storage/innobase/buf/buf0buf.c5
1 files changed, 4 insertions, 1 deletions
diff --git a/storage/innobase/buf/buf0buf.c b/storage/innobase/buf/buf0buf.c
index b6bfcc3dbc0..4963f1c30c3 100644
--- a/storage/innobase/buf/buf0buf.c
+++ b/storage/innobase/buf/buf0buf.c
@@ -1,6 +1,6 @@
/*****************************************************************************
-Copyright (c) 1995, 2014, Oracle and/or its affiliates. All Rights Reserved.
+Copyright (c) 1995, 2015, Oracle and/or its affiliates. All Rights Reserved.
Copyright (c) 2008, Google Inc.
Portions of this file contain modifications contributed and copyrighted by
@@ -1528,6 +1528,9 @@ buf_pool_watch_set(
return(NULL);
}
+ /* The maximum number of purge threads should never exceed
+ BUF_POOL_WATCH_SIZE. So there is no way for purge thread
+ instance to hold a watch when setting another watch. */
for (i = 0; i < BUF_POOL_WATCH_SIZE; i++) {
bpage = &buf_pool->watch[i];