Skip to content

Commit eab4e59

Browse files
committed
Misc
1 parent 2764c75 commit eab4e59

File tree

5 files changed

+16
-11
lines changed

5 files changed

+16
-11
lines changed

storage/innobase/buf/buf0dblwr.cc

Lines changed: 10 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -659,7 +659,8 @@ buf_dblwr_update(
659659
mutex_exit(&buf_dblwr->mutex);
660660
/* This will finish the batch. Sync data files
661661
to the disk. */
662-
fil_flush_file_spaces(FIL_TABLESPACE);
662+
if (bpage->isShared == 0)
663+
fil_flush_file_spaces(FIL_TABLESPACE);
663664
mutex_enter(&buf_dblwr->mutex);
664665

665666
/* We can now reuse the doublewrite memory buffer: */
@@ -1154,12 +1155,15 @@ buf_dblwr_flush_buffered_writes(void)
11541155
#if 1
11551156
fil_share_complete_io( get_space_id(buf_dblwr->buf_block_arr[i]),
11561157
buf_block_get_page_no((buf_block_t*)buf_dblwr->buf_block_arr[i]));
1157-
if (fil_share_is_table(get_space_id(buf_dblwr->buf_block_arr[i])))
1158+
if (fil_share_is_table(get_space_id(buf_dblwr->buf_block_arr[i]))) {
1159+
buf_dblwr->buf_block_arr[i]->isShared = 1;
11581160
buf_page_io_complete(buf_dblwr->buf_block_arr[i]);
1161+
buf_dblwr->buf_block_arr[i]->isShared = 0;
1162+
}
11591163
//buf_page_share_complete(buf_dblwr->buf_block_arr[i]);
11601164
#endif
11611165
}
1162-
fsync(share_fd); /// FIXME: is this really needed?
1166+
//fsync(share_fd); /// FIXME: is this really needed?
11631167
} else {
11641168
/* Up to this point first_free and buf_dblwr->first_free are
11651169
same because we have set the buf_dblwr->batch_running flag
@@ -1426,9 +1430,11 @@ buf_dblwr_write_single_page(
14261430
buf_block_get_page_no((buf_block_t*)bpage));
14271431
fil_share_complete_io(TRX_SYS_SPACE, offset);
14281432

1433+
bpage->isShared = 1;
14291434
if (fil_share_is_table(get_space_id(bpage)))
14301435
buf_page_io_complete(bpage);
1431-
fsync(share_fd); /// FIXME: is this really needed?
1436+
bpage->isShared = 0;
1437+
//fsync(share_fd); /// FIXME: is this really needed?
14321438
#endif
14331439
} else{
14341440
/* We know that the write has been flushed to disk now

storage/innobase/buf/buf0lru.cc

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -850,8 +850,7 @@ buf_LRU_remove_pages(
850850
buf_flush_dirty_pages(buf_pool, id, true, trx);
851851
/* Ensure that all asynchronous IO is completed. */
852852
os_aio_wait_until_no_pending_writes();
853-
if (srv_use_share == 0) //ogh: we don't need flush
854-
fil_flush(id);
853+
fil_flush(id);
855854
break;
856855
}
857856
}

storage/innobase/fil/fil0fil.cc

Lines changed: 2 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1060,9 +1060,7 @@ fil_mutex_enter_and_prepare_for_io(
10601060

10611061
/* Flush tablespaces so that we can close modified
10621062
files in the LRU list */
1063-
if (srv_use_share == 0) { //ogh
1064-
fil_flush_file_spaces(FIL_TABLESPACE);
1065-
}
1063+
fil_flush_file_spaces(FIL_TABLESPACE);
10661064

10671065
os_thread_sleep(20000);
10681066

@@ -5591,7 +5589,7 @@ fil_get_fd_offset(
55915589
offset = ((os_offset_t) block_offset << zip_size_shift);
55925590
}
55935591

5594-
#if 1 || defined(DEBUG_SHARE)
5592+
#if 0 || defined(DEBUG_SHARE)
55955593
ib_logf(IB_LOG_LEVEL_INFO,
55965594
"Fille name: %s", node->name);
55975595
ib_logf(IB_LOG_LEVEL_INFO,

storage/innobase/include/buf0buf.h

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1632,6 +1632,8 @@ struct buf_page_t{
16321632
or buf_block_t::mutex. */
16331633
# endif /* UNIV_DEBUG_FILE_ACCESSES || UNIV_DEBUG */
16341634
#endif /* !UNIV_HOTBACKUP */
1635+
//ogh
1636+
unsigned isShared;
16351637
};
16361638

16371639
/** The buffer control block structure */

storage/innobase/log/log0log.cc

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2090,7 +2090,7 @@ log_checkpoint(
20902090
recv_apply_hashed_log_recs(TRUE);
20912091
}
20922092

2093-
if (!srv_use_share && srv_unix_file_flush_method != SRV_UNIX_NOSYNC) { //ogh
2093+
if (srv_unix_file_flush_method != SRV_UNIX_NOSYNC) { //ogh
20942094
fil_flush_file_spaces(FIL_TABLESPACE);
20952095
}
20962096

0 commit comments

Comments
 (0)