Skip to content

Commit 6da3afd

Browse files
committed
Need to fix signal 11 error caused by spf
1 parent 923f7f5 commit 6da3afd

File tree

5 files changed

+42
-74
lines changed

5 files changed

+42
-74
lines changed

storage/innobase/buf/buf0buf.cc

Lines changed: 11 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -2048,6 +2048,7 @@ nvdimm_buf_pool_init(
20482048
}
20492049
}
20502050

2051+
//nvdimm_buf_LRU_old_ratio_update(95, FALSE);
20512052
nvdimm_buf_LRU_old_ratio_update(100 * 3 / 8, FALSE);
20522053

20532054
return(DB_SUCCESS);
@@ -6168,7 +6169,15 @@ buf_page_io_complete(
61686169
if (uncompressed) {
61696170
rw_lock_sx_unlock_gen(&((buf_block_t*) bpage)->lock,
61706171
BUF_IO_WRITE);
6171-
}
6172+
6173+
if (bpage->id.space() == 30) {
6174+
ib::info() << bpage->id.space() << " " << bpage->id.page_no()
6175+
<< " is unlocked from " << bpage->buf_pool_index
6176+
<< " with " << bpage->flush_type
6177+
<< " cached? " << bpage->cached_in_nvdimm
6178+
<< " moved? " << bpage->moved_to_nvdimm;
6179+
}
6180+
}
61726181

61736182
buf_pool->stat.n_pages_written++;
61746183

@@ -6189,7 +6198,6 @@ buf_page_io_complete(
61896198
srv_stats.nvdimm_pages_written_no.inc();
61906199
}
61916200
#endif /* UNIV_NVDIMM_CACHE_NO */
6192-
bpage->cached_in_nvdimm = false;
61936201
}
61946202
#endif /* UNIV_NVDIMM_CACHE */
61956203

@@ -6212,6 +6220,7 @@ buf_page_io_complete(
62126220
buf_LRU_free_page(bpage, true);
62136221
#ifdef NVDIMM_CACHE
62146222
bpage->moved_to_nvdimm = false;
6223+
bpage->cached_in_nvdimm = false;
62156224
#endif /* NVDIMM_CACHE */
62166225
} else {
62176226
mutex_exit(buf_page_get_mutex(bpage));

storage/innobase/buf/buf0dblwr.cc

Lines changed: 4 additions & 42 deletions
Original file line numberDiff line numberDiff line change
@@ -727,9 +727,10 @@ buf_dblwr_update(
727727
if (!srv_use_doublewrite_buf
728728
|| buf_dblwr == NULL
729729
|| fsp_is_system_temporary(bpage->id.space())
730-
//#ifdef UNIV_NVDIMM_CACHE
731-
// || bpage->cached_in_nvdimm
732-
//#endif /* UNIV_NVDIMM_CACHE */
730+
#ifdef UNIV_NVDIMM_CACHE
731+
|| bpage->cached_in_nvdimm
732+
|| bpage->moved_to_nvdimm
733+
#endif /* UNIV_NVDIMM_CACHE */
733734
) {
734735
return;
735736
}
@@ -764,32 +765,6 @@ buf_dblwr_update(
764765
break;
765766
case BUF_FLUSH_SINGLE_PAGE:
766767
{
767-
#ifdef UNIV_NVDIMM_CACHE
768-
if (!bpage->moved_to_nvdimm && !bpage->cached_in_nvdimm) {
769-
const ulint size = 2 * TRX_SYS_DOUBLEWRITE_BLOCK_SIZE;
770-
ulint i;
771-
mutex_enter(&buf_dblwr->mutex);
772-
for (i = srv_doublewrite_batch_size; i < size; ++i) {
773-
if (buf_dblwr->buf_block_arr[i] == bpage) {
774-
buf_dblwr->s_reserved--;
775-
buf_dblwr->buf_block_arr[i] = NULL;
776-
buf_dblwr->in_use[i] = false;
777-
break;
778-
}
779-
}
780-
781-
/* The block we are looking for must exist as a
782-
reserved block. */
783-
if (i >= size) {
784-
ib::info() << bpage->id.space() << " "
785-
<< bpage->id.page_no() << " in " << bpage->buf_pool_index
786-
<< " cached? " << bpage->cached_in_nvdimm
787-
<< " moved? " << bpage->moved_to_nvdimm
788-
<< " " << i << " ? " << size << " " << srv_doublewrite_batch_size;
789-
}
790-
ut_a(i < size);
791-
}
792-
#else
793768
const ulint size = 2 * TRX_SYS_DOUBLEWRITE_BLOCK_SIZE;
794769
ulint i;
795770
mutex_enter(&buf_dblwr->mutex);
@@ -805,7 +780,6 @@ buf_dblwr_update(
805780
/* The block we are looking for must exist as a
806781
reserved block. */
807782
ut_a(i < size);
808-
#endif /* UNIV_NVDIMM_CACHE */
809783
}
810784
os_event_set(buf_dblwr->s_event);
811785
mutex_exit(&buf_dblwr->mutex);
@@ -924,13 +898,6 @@ buf_dblwr_write_block_to_datafile(
924898
bool sync) /*!< in: true if sync IO
925899
is requested */
926900
{
927-
928-
if (!buf_page_in_file(bpage)) {
929-
ib::info() << bpage->id.space() << " "
930-
<< bpage->id.page_no() << " in " << bpage->buf_pool_index
931-
<< " " << sync << " " << buf_page_get_state(bpage);
932-
}
933-
934901
ut_a(buf_page_in_file(bpage));
935902

936903
ulint type = IORequest::WRITE;
@@ -1186,11 +1153,6 @@ buf_dblwr_add_to_batch(
11861153
ut_ad(buf_dblwr->first_free == buf_dblwr->b_reserved);
11871154
ut_ad(buf_dblwr->b_reserved <= srv_doublewrite_batch_size);
11881155

1189-
ib::info() << bpage->id.space() << " " << bpage->id.page_no()
1190-
<< " in " << bpage->buf_pool_index
1191-
<< " with " << bpage->flush_type
1192-
<< " dwb total = " << buf_dblwr->first_free;
1193-
11941156
if (buf_dblwr->first_free == srv_doublewrite_batch_size) {
11951157
mutex_exit(&(buf_dblwr->mutex));
11961158

storage/innobase/buf/buf0flu.cc

Lines changed: 24 additions & 27 deletions
Original file line numberDiff line numberDiff line change
@@ -1103,17 +1103,22 @@ buf_flush_write_block_low(
11031103

11041104
/* Set the oldest LSN of the NVDIMM page to the previous newest LSN. */
11051105
buf_flush_note_modification((buf_block_t *)nvdimm_page, bpage->newest_modification, bpage->newest_modification, nvdimm_page->flush_observer);
1106-
1106+
1107+
ib::info() << bpage->id.space() << " " << bpage->id.page_no()
1108+
<< " before io_complete " << bpage->buf_pool_index
1109+
<< " with " << bpage->flush_type;
1110+
11071111
/* Remove the target page from the original buffer pool. */
1108-
buf_page_io_complete(nvdimm_page);
11091112
buf_page_io_complete(bpage, true);
1113+
buf_page_io_complete(nvdimm_page);
11101114

11111115
buf_pool_t* buf_pool = buf_pool_from_bpage(nvdimm_page);
11121116
ib::info() << nvdimm_page->id.space() << " "
11131117
<< nvdimm_page->id.page_no() << " is moved to "
1114-
<< nvdimm_page->buf_pool_index << " ?= " << buf_pool->instance_no << " and " << bpage->buf_pool_index
1115-
<< " total = " << UT_LIST_GET_LEN(buf_pool->free);
1118+
<< nvdimm_page->buf_pool_index << " from " << bpage->buf_pool_index;
11161119
} else {
1120+
bpage->moved_to_nvdimm = false;
1121+
11171122
if (!srv_use_doublewrite_buf
11181123
|| buf_dblwr == NULL
11191124
|| srv_read_only_mode
@@ -1148,9 +1153,15 @@ buf_flush_write_block_low(
11481153
and we flush the changes to disk only for the tablespace we
11491154
are working on. */
11501155
if (sync) {
1151-
ut_ad(flush_type == BUF_FLUSH_SINGLE_PAGE);
1152-
fil_flush(bpage->id.space());
1153-
1156+
if (!bpage->cached_in_nvdimm) {
1157+
ut_ad(flush_type == BUF_FLUSH_SINGLE_PAGE);
1158+
fil_flush(bpage->id.space());
1159+
}
1160+
1161+
/*ib::info() << bpage->id.space() << " "
1162+
<< bpage->id.page_no() << " is spf "
1163+
<< bpage->buf_pool_index << " cached? " << bpage->cached_in_nvdimm;
1164+
*/
11541165
/* true means we want to evict this page from the
11551166
LRU list as well. */
11561167
buf_page_io_complete(bpage, true);
@@ -1285,7 +1296,7 @@ buf_flush_page(
12851296

12861297
if ((page_type == FIL_PAGE_INDEX || page_type == FIL_PAGE_RTREE) /* Index page */
12871298
&& page_is_leaf(frame) /* Leaf page */) {
1288-
//ib::info() << bpage->id.space() << " " << bpage->id.page_no() << " " << bpage->flush_type;
1299+
ib::info() << bpage->id.space() << " " << bpage->id.page_no() << " ready to move nvdimm.. " << bpage->flush_type;
12891300
bpage->moved_to_nvdimm = true;
12901301
srv_stats.nvdimm_pages_stored_ol.inc();
12911302
}
@@ -1316,21 +1327,6 @@ buf_flush_page(
13161327
if (flush_type == BUF_FLUSH_LIST
13171328
&& is_uncompressed
13181329
&& !rw_lock_sx_lock_nowait(rw_lock, BUF_IO_WRITE)) {
1319-
1320-
/*#ifdef UNIV_NVDIMM_CACHE
1321-
if (!bpage->moved_to_nvdimm) {
1322-
if (!fsp_is_system_temporary(bpage->id.space())) {
1323-
*/ /* avoiding deadlock possibility involves
1324-
doublewrite buffer, should flush it, because
1325-
it might hold the another block->lock. */
1326-
/* buf_dblwr_flush_buffered_writes();
1327-
} else {
1328-
buf_dblwr_sync_datafiles();
1329-
}
1330-
} else {
1331-
buf_dblwr_sync_datafiles();
1332-
}
1333-
#else*/
13341330
if (!fsp_is_system_temporary(bpage->id.space())) {
13351331
/* avoiding deadlock possibility involves
13361332
doublewrite buffer, should flush it, because
@@ -1339,7 +1335,6 @@ buf_flush_page(
13391335
} else {
13401336
buf_dblwr_sync_datafiles();
13411337
}
1342-
//#endif /* UNIV_NVDIMM_CACHE */
13431338
rw_lock_sx_lock_gen(rw_lock, BUF_IO_WRITE);
13441339
}
13451340

@@ -1362,7 +1357,6 @@ buf_flush_page(
13621357
buffer pool or removed from flush_list or LRU_list. */
13631358

13641359
buf_flush_write_block_low(bpage, flush_type, sync);
1365-
13661360
}
13671361

13681362
return(flush);
@@ -2310,6 +2304,7 @@ buf_flush_single_page_from_LRU(
23102304

23112305
buf_pool_mutex_enter(buf_pool);
23122306

2307+
ib::info() << "start spf " << buf_pool->instance_no;
23132308
for (bpage = buf_pool->single_scan_itr.start(), scanned = 0,
23142309
freed = false;
23152310
bpage != NULL;
@@ -2320,8 +2315,8 @@ buf_flush_single_page_from_LRU(
23202315
buf_page_t* prev = UT_LIST_GET_PREV(LRU, bpage);
23212316

23222317
#ifdef UNIV_NVDIMM_CACHE
2323-
if (prev == NULL/* && buf_pool->instance_no == 8*/) {
2324-
ib::info() << "null error in " << buf_pool->instance_no;
2318+
if (!prev/* && buf_pool->instance_no == 8*/) {
2319+
ib::info() << UT_LIST_GET_LEN(buf_pool->LRU) << " error in " << buf_pool->instance_no;
23252320
break;
23262321
}
23272322
#endif /* UNIV_NVDIMM_CACHE */
@@ -2370,6 +2365,8 @@ buf_flush_single_page_from_LRU(
23702365

23712366
ut_ad(!mutex_own(block_mutex));
23722367
}
2368+
ib::info() << "finish spf " << buf_pool->instance_no << " scanned = "
2369+
<< scanned << " free? " << freed;
23732370

23742371
if (!freed) {
23752372
/* Can't find a single flushable page. */

storage/innobase/buf/buf0lru.cc

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1443,7 +1443,7 @@ buf_LRU_get_free_block(
14431443
involved (particularly in case of compressed pages). We
14441444
can do that in a separate patch sometime in future. */
14451445

1446-
//if (buf_pool->instance_no < 8) {
1446+
if (buf_pool->instance_no < 8) {
14471447
if (!buf_flush_single_page_from_LRU(buf_pool)) {
14481448
MONITOR_INC(MONITOR_LRU_SINGLE_FLUSH_FAILURE_COUNT);
14491449
++flush_failures;
@@ -1452,7 +1452,7 @@ buf_LRU_get_free_block(
14521452
srv_stats.buf_pool_wait_free.add(n_iterations, 1);
14531453

14541454
n_iterations++;
1455-
//}
1455+
}
14561456

14571457
goto loop;
14581458
}

storage/innobase/include/buf0buf.ic

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -111,7 +111,7 @@ buf_pool_from_bpage(
111111
return(&nvdimm_buf_pool_ptr[0]);
112112
}
113113
#ifdef UNIV_NVDIMM_CACHE_ST
114-
if { /* Stock */
114+
else { /* Stock */
115115
return(&nvdimm_buf_pool_ptr[1]);
116116
}
117117
#endif /* UNIV_NVDIMM_CACHE_ST */

0 commit comments

Comments
 (0)