Skip to content

Commit d22aa94

Browse files
committed
Need to fix deadlock error
1 parent 4dc2328 commit d22aa94

File tree

2 files changed

+32
-9
lines changed

2 files changed

+32
-9
lines changed

storage/innobase/buf/buf0buf.cc

Lines changed: 20 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -5248,8 +5248,12 @@ buf_page_init_low(
52485248
HASH_INVALIDATE(bpage, hash);
52495249

52505250
#ifdef UNIV_NVDIMM_CACHE
5251-
bpage->cached_in_nvdimm = false;
52525251
bpage->moved_to_nvdimm = false;
5252+
if (bpage->buf_pool_index >= srv_buf_pool_instances) {
5253+
bpage->cached_in_nvdimm = true;
5254+
} else {
5255+
bpage->cached_in_nvdimm = false;
5256+
}
52535257
#endif /* UNIV_NVDIMM_CACHE */
52545258

52555259
ut_d(bpage->file_page_was_freed = FALSE);
@@ -5335,7 +5339,7 @@ buf_page_init(
53355339
block->page.id.copy_from(page_id);
53365340
block->page.size.copy_from(page_size);
53375341

5338-
HASH_INSERT(buf_page_t, hash, buf_pool->page_hash,
5342+
HASH_INSERT(buf_page_t, hash, buf_pool->page_hash,
53395343
page_id.fold(), &block->page);
53405344

53415345
if (page_size.is_compressed()) {
@@ -6144,9 +6148,9 @@ buf_page_io_complete(
61446148
}
61456149

61466150
#ifdef UNIV_NVDIMM_CACHE
6147-
if (buf_pool->instance_no >= 8
6148-
&& !bpage->cached_in_nvdimm) {
6149-
bpage->cached_in_nvdimm = true;
6151+
if (/*buf_pool->instance_no >= 8
6152+
&& !*/bpage->cached_in_nvdimm) {
6153+
//bpage->cached_in_nvdimm = true;
61506154

61516155
if (bpage->id.space() == 30) {
61526156
srv_stats.nvdimm_pages_stored_ol.inc();
@@ -6240,7 +6244,7 @@ buf_page_io_complete(
62406244
buf_LRU_free_page(bpage, true);
62416245
#ifdef NVDIMM_CACHE
62426246
bpage->moved_to_nvdimm = false;
6243-
bpage->cached_in_nvdimm = false;
6247+
//bpage->cached_in_nvdimm = false;
62446248
#endif /* NVDIMM_CACHE */
62456249
} else {
62466250
mutex_exit(buf_page_get_mutex(bpage));
@@ -7167,6 +7171,13 @@ buf_print_io_instance(
71677171
pool_info->lru_len, pool_info->unzip_lru_len,
71687172
pool_info->io_sum, pool_info->io_cur,
71697173
pool_info->unzip_sum, pool_info->unzip_cur);
7174+
7175+
#ifdef UNIV_NVDIMM_CACHE
7176+
fprintf(file, "Total number of page read performed = " ULINTPF "\n", pool_info->n_pages_read);
7177+
fprintf(file, "Total number of page created performed = " ULINTPF "\n", pool_info->n_pages_created);
7178+
fprintf(file, "Total number of page written performed = " ULINTPF "\n", pool_info->n_pages_written);
7179+
fprintf(file, "Total number of page gets performed = " ULINTPF "\n", pool_info->n_page_gets);
7180+
#endif /* UNIV_NVDIMM_CACHE */
71707181
}
71717182

71727183
#ifdef UNIV_NVDIMM_CACHE
@@ -7222,6 +7233,9 @@ buf_print_nvdimm_instance(
72227233
(ulint)srv_stats.nvdimm_pages_written_od,
72237234
(ulint)srv_stats.nvdimm_pages_written_st);
72247235

7236+
fprintf(file, "Total number of page read performed = " ULINTPF "\n", pool_info->n_pages_read);
7237+
fprintf(file, "Total number of page created performed = " ULINTPF "\n", pool_info->n_pages_created);
7238+
fprintf(file, "Total number of page written performed = " ULINTPF "\n", pool_info->n_pages_written);
72257239
fprintf(file, "Total number of page gets performed = " ULINTPF "\n", pool_info->n_page_gets);
72267240
}
72277241
#endif /* UNIV_NVDIMM_CACHE */

storage/innobase/buf/buf0flu.cc

Lines changed: 12 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1121,7 +1121,8 @@ buf_flush_write_block_low(
11211121
<< " flush-type: " << flush_type
11221122
<< " buf-fix: " << bpage->buf_fix_count
11231123
<< " with oldest: " << bpage->oldest_modification
1124-
<< " newest: " << bpage->newest_modification;
1124+
<< " newest: " << bpage->newest_modification
1125+
<< " lsn-gap: " << bpage->newest_modification - bpage->oldest_modification;
11251126
*/
11261127
if (!srv_use_doublewrite_buf
11271128
|| buf_dblwr == NULL
@@ -1136,9 +1137,9 @@ buf_flush_write_block_low(
11361137

11371138
IORequest request(type);
11381139

1139-
lsn_t lsn_gap = bpage->newest_modification - bpage->oldest_modification;
1140+
/*lsn_t lsn_gap = bpage->newest_modification - bpage->oldest_modification;
11401141
1141-
/*ib::info() << bpage->id.space() << " " << bpage->id.page_no()
1142+
ib::info() << bpage->id.space() << " " << bpage->id.page_no()
11421143
<< " is batch written. cached? " << bpage->cached_in_nvdimm
11431144
<< " moved? " << bpage->moved_to_nvdimm
11441145
<< " flush-type: " << flush_type
@@ -1177,6 +1178,14 @@ buf_flush_write_block_low(
11771178
}
11781179
}
11791180
#else
1181+
1182+
/*ib::info() << bpage->id.space() << " " << bpage->id.page_no()
1183+
<< " is batch written. flush-type: " << flush_type
1184+
<< " buf-fix: " << bpage->buf_fix_count
1185+
<< " with oldest: " << bpage->oldest_modification
1186+
<< " newest: " << bpage->newest_modification
1187+
<< " lsn-gap: " << bpage->newest_modification - bpage->oldest_modification;
1188+
*/
11801189
if (!srv_use_doublewrite_buf
11811190
|| buf_dblwr == NULL
11821191
|| srv_read_only_mode

0 commit comments

Comments
 (0)