summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorMarko Mäkelä <marko.makela@mariadb.com>2020-06-08 15:43:55 +0300
committerMarko Mäkelä <marko.makela@mariadb.com>2020-06-08 21:03:58 +0300
commit288af748cbb720ff736f7a3a81e7d0d6fb74c6c8 (patch)
treeac419912bfad8cd001b99ecca556fb3cf6085363
parent1b01833a4b376a392a8af6ca6b9bc06c4e6e09f0 (diff)
downloadmariadb-git-10.5-MDEV-15053-fixes.tar.gz
WIP: Disable buf_page_t::access_time10.5-MDEV-15053-fixes
-rw-r--r--mysql-test/suite/innodb_i_s/innodb_buffer_page_lru.result2
-rw-r--r--storage/innobase/buf/buf0buf.cc6
-rw-r--r--storage/innobase/handler/i_s.cc11
-rw-r--r--storage/innobase/include/buf0buf.h24
-rw-r--r--storage/innobase/include/buf0buf.ic19
5 files changed, 11 insertions, 51 deletions
diff --git a/mysql-test/suite/innodb_i_s/innodb_buffer_page_lru.result b/mysql-test/suite/innodb_i_s/innodb_buffer_page_lru.result
index 42d33fdbeac..4b4884a796b 100644
--- a/mysql-test/suite/innodb_i_s/innodb_buffer_page_lru.result
+++ b/mysql-test/suite/innodb_i_s/innodb_buffer_page_lru.result
@@ -11,7 +11,7 @@ INNODB_BUFFER_PAGE_LRU CREATE TEMPORARY TABLE `INNODB_BUFFER_PAGE_LRU` (
`IS_HASHED` int(1) NOT NULL DEFAULT 0,
`NEWEST_MODIFICATION` bigint(21) unsigned NOT NULL DEFAULT 0,
`OLDEST_MODIFICATION` bigint(21) unsigned NOT NULL DEFAULT 0,
- `ACCESS_TIME` bigint(21) unsigned NOT NULL DEFAULT 0,
+ `ACCESS_TIME` bigint(21) unsigned DEFAULT NULL,
`TABLE_NAME` varchar(1024) DEFAULT NULL,
`INDEX_NAME` varchar(64) DEFAULT NULL,
`NUMBER_RECORDS` bigint(21) unsigned NOT NULL DEFAULT 0,
diff --git a/storage/innobase/buf/buf0buf.cc b/storage/innobase/buf/buf0buf.cc
index e17460a8cee..e5bfd1e1b5d 100644
--- a/storage/innobase/buf/buf0buf.cc
+++ b/storage/innobase/buf/buf0buf.cc
@@ -2512,7 +2512,6 @@ retry:
watch when setting another watch. */
for (buf_page_t *w= &watch[UT_ARR_SIZE(watch)]; w-- >= watch; )
{
- ut_ad(w->access_time == 0);
ut_ad(!w->oldest_modification());
ut_ad(!w->zip.data);
ut_ad(!w->in_zip_hash);
@@ -3002,7 +3001,6 @@ buf_page_get_low(
bool allow_ibuf_merge)
{
buf_block_t* block;
- unsigned access_time;
ulint retries = 0;
const ulint fold = page_id.fold();
@@ -3356,9 +3354,7 @@ evict_from_pool:
rw_lock_x_unlock(hash_lock);
buf_pool.n_pend_unzip++;
- access_time = block->page.is_accessed();
-
- if (!access_time && !recv_no_ibuf_operations
+ if (UNIV_UNLIKELY(!recv_no_ibuf_operations)
&& ibuf_page_exists(block->page.id(), zip_size)) {
block->page.ibuf_exist = true;
}
diff --git a/storage/innobase/handler/i_s.cc b/storage/innobase/handler/i_s.cc
index d2d9a546969..710174c745f 100644
--- a/storage/innobase/handler/i_s.cc
+++ b/storage/innobase/handler/i_s.cc
@@ -116,7 +116,6 @@ struct buf_page_info_t{
ulint block_id; /*!< Buffer Pool block ID */
/** page identifier */
page_id_t id;
- unsigned access_time:32; /*!< Time of first access */
unsigned io_fix:2; /*!< type of pending I/O operation */
uint32_t fix_count; /*!< Count of how manyfold this block
is bufferfixed */
@@ -3996,8 +3995,7 @@ i_s_innodb_buffer_page_fill(
OK(fields[IDX_BUFFER_PAGE_OLDEST_MOD]->store(
page_info->oldest_mod, true));
- OK(fields[IDX_BUFFER_PAGE_ACCESS_TIME]->store(
- page_info->access_time, true));
+ fields[IDX_BUFFER_PAGE_ACCESS_TIME]->set_null();
fields[IDX_BUFFER_PAGE_TABLE_NAME]->set_null();
@@ -4168,8 +4166,6 @@ i_s_innodb_buffer_page_get_info(
page_info->oldest_mod = bpage->oldest_modification();
- page_info->access_time = bpage->access_time;
-
page_info->zip_ssize = bpage->zip.ssize;
page_info->io_fix = bpage->io_fix() & 3;
@@ -4408,7 +4404,7 @@ static ST_FIELD_INFO i_s_innodb_buf_page_lru_fields_info[] =
Column("OLDEST_MODIFICATION",ULonglong(), NOT_NULL),
#define IDX_BUF_LRU_PAGE_ACCESS_TIME 9 + I_S_AHI
- Column("ACCESS_TIME",ULonglong(), NOT_NULL),
+ Column("ACCESS_TIME",ULonglong(), NULLABLE),
#define IDX_BUF_LRU_PAGE_TABLE_NAME 10 + I_S_AHI
Column("TABLE_NAME", Varchar(1024), NULLABLE),
@@ -4500,8 +4496,7 @@ i_s_innodb_buf_page_lru_fill(
OK(fields[IDX_BUF_LRU_PAGE_OLDEST_MOD]->store(
page_info->oldest_mod, true));
- OK(fields[IDX_BUF_LRU_PAGE_ACCESS_TIME]->store(
- page_info->access_time, true));
+ fields[IDX_BUF_LRU_PAGE_ACCESS_TIME]->set_null();
fields[IDX_BUF_LRU_PAGE_TABLE_NAME]->set_null();
diff --git a/storage/innobase/include/buf0buf.h b/storage/innobase/include/buf0buf.h
index 522441259dd..58a4f718a6e 100644
--- a/storage/innobase/include/buf0buf.h
+++ b/storage/innobase/include/buf0buf.h
@@ -930,18 +930,8 @@ public:
purposes without holding any
mutex or latch */
/* @} */
- Atomic_counter<unsigned> access_time; /*!< time of first access, or
- 0 if the block was never accessed
- in the buffer pool.
-
- For state==BUF_BLOCK_MEMORY
- blocks, this field can be repurposed
- for something else.
-
- When this field counts log records
- and bytes allocated for recv_sys.pages,
- the field is protected by
- recv_sys_t::mutex. */
+ /** used by recv_sys_t::add() only */
+ unsigned access_time;
/** Change buffer entries for the page exist.
Protected by io_fix()==BUF_IO_READ or by buf_block_t::lock. */
bool ibuf_exist;
@@ -974,7 +964,6 @@ public:
buf_fix_count_= 0;
old= 0;
freed_page_clock= 0;
- access_time= 0;
oldest_modification_= 0;
slot= nullptr;
ibuf_exist= false;
@@ -1088,15 +1077,10 @@ public:
inline void set_old(bool old);
/** Flag a page accessed in buf_pool
@return whether this is not the first access */
- bool set_accessed()
- {
- if (is_accessed()) return true;
- access_time= static_cast<uint32_t>(ut_time_ms());
- return false;
- }
+ bool set_accessed() const { return false; }
/** @return ut_time_ms() at the time of first access of a block in buf_pool
@retval 0 if not accessed */
- unsigned is_accessed() const { ut_ad(in_file()); return access_time; }
+ unsigned is_accessed() const { ut_ad(in_file()); return 0; }
};
/** The buffer control block structure */
diff --git a/storage/innobase/include/buf0buf.ic b/storage/innobase/include/buf0buf.ic
index bace66d5a39..3661820fd12 100644
--- a/storage/innobase/include/buf0buf.ic
+++ b/storage/innobase/include/buf0buf.ic
@@ -100,23 +100,8 @@ inline bool buf_page_peek_if_too_old(const buf_page_t *bpage)
statistics or move blocks in the LRU list. This is
either the warm-up phase or an in-memory workload. */
return(FALSE);
- } else if (buf_LRU_old_threshold_ms && bpage->old) {
- uint32_t access_time = bpage->is_accessed();
-
- /* It is possible that the below comparison returns an
- unexpected result. 2^32 milliseconds pass in about 50 days,
- so if the difference between ut_time_ms() and access_time
- is e.g. 50 days + 15 ms, then the below will behave as if
- it is 15 ms. This is known and fixing it would require to
- increase buf_page_t::access_time from 32 to 64 bits. */
- if (access_time
- && ((ib_uint32_t) (ut_time_ms() - access_time))
- >= buf_LRU_old_threshold_ms) {
- return(TRUE);
- }
-
- buf_pool.stat.n_pages_not_made_young++;
- return false;
+ } else if (bpage->old && buf_LRU_old_threshold_ms) {
+ return true;
} else {
return !buf_page_peek_if_young(bpage);
}