Skip to content

Commit

Permalink
Misc
Browse files Browse the repository at this point in the history
  • Loading branch information
wurikiji committed Sep 5, 2018
1 parent 2764c75 commit eab4e59
Show file tree
Hide file tree
Showing 5 changed files with 16 additions and 11 deletions.
14 changes: 10 additions & 4 deletions storage/innobase/buf/buf0dblwr.cc
Original file line number Diff line number Diff line change
Expand Up @@ -659,7 +659,8 @@ buf_dblwr_update(
mutex_exit(&buf_dblwr->mutex);
/* This will finish the batch. Sync data files
to the disk. */
fil_flush_file_spaces(FIL_TABLESPACE);
if (bpage->isShared == 0)
fil_flush_file_spaces(FIL_TABLESPACE);
mutex_enter(&buf_dblwr->mutex);

/* We can now reuse the doublewrite memory buffer: */
Expand Down Expand Up @@ -1154,12 +1155,15 @@ buf_dblwr_flush_buffered_writes(void)
#if 1
fil_share_complete_io( get_space_id(buf_dblwr->buf_block_arr[i]),
buf_block_get_page_no((buf_block_t*)buf_dblwr->buf_block_arr[i]));
if (fil_share_is_table(get_space_id(buf_dblwr->buf_block_arr[i])))
if (fil_share_is_table(get_space_id(buf_dblwr->buf_block_arr[i]))) {
buf_dblwr->buf_block_arr[i]->isShared = 1;
buf_page_io_complete(buf_dblwr->buf_block_arr[i]);
buf_dblwr->buf_block_arr[i]->isShared = 0;
}
//buf_page_share_complete(buf_dblwr->buf_block_arr[i]);
#endif
}
fsync(share_fd); /// FIXME: is this really needed?
//fsync(share_fd); /// FIXME: is this really needed?
} else {
/* Up to this point first_free and buf_dblwr->first_free are
same because we have set the buf_dblwr->batch_running flag
Expand Down Expand Up @@ -1426,9 +1430,11 @@ buf_dblwr_write_single_page(
buf_block_get_page_no((buf_block_t*)bpage));
fil_share_complete_io(TRX_SYS_SPACE, offset);

bpage->isShared = 1;
if (fil_share_is_table(get_space_id(bpage)))
buf_page_io_complete(bpage);
fsync(share_fd); /// FIXME: is this really needed?
bpage->isShared = 0;
//fsync(share_fd); /// FIXME: is this really needed?
#endif
} else{
/* We know that the write has been flushed to disk now
Expand Down
3 changes: 1 addition & 2 deletions storage/innobase/buf/buf0lru.cc
Original file line number Diff line number Diff line change
Expand Up @@ -850,8 +850,7 @@ buf_LRU_remove_pages(
buf_flush_dirty_pages(buf_pool, id, true, trx);
/* Ensure that all asynchronous IO is completed. */
os_aio_wait_until_no_pending_writes();
if (srv_use_share == 0) //ogh: we don't need flush
fil_flush(id);
fil_flush(id);
break;
}
}
Expand Down
6 changes: 2 additions & 4 deletions storage/innobase/fil/fil0fil.cc
Original file line number Diff line number Diff line change
Expand Up @@ -1060,9 +1060,7 @@ fil_mutex_enter_and_prepare_for_io(

/* Flush tablespaces so that we can close modified
files in the LRU list */
if (srv_use_share == 0) { //ogh
fil_flush_file_spaces(FIL_TABLESPACE);
}
fil_flush_file_spaces(FIL_TABLESPACE);

os_thread_sleep(20000);

Expand Down Expand Up @@ -5591,7 +5589,7 @@ fil_get_fd_offset(
offset = ((os_offset_t) block_offset << zip_size_shift);
}

#if 1 || defined(DEBUG_SHARE)
#if 0 || defined(DEBUG_SHARE)
ib_logf(IB_LOG_LEVEL_INFO,
"Fille name: %s", node->name);
ib_logf(IB_LOG_LEVEL_INFO,
Expand Down
2 changes: 2 additions & 0 deletions storage/innobase/include/buf0buf.h
Original file line number Diff line number Diff line change
Expand Up @@ -1632,6 +1632,8 @@ struct buf_page_t{
or buf_block_t::mutex. */
# endif /* UNIV_DEBUG_FILE_ACCESSES || UNIV_DEBUG */
#endif /* !UNIV_HOTBACKUP */
//ogh
unsigned isShared;
};

/** The buffer control block structure */
Expand Down
2 changes: 1 addition & 1 deletion storage/innobase/log/log0log.cc
Original file line number Diff line number Diff line change
Expand Up @@ -2090,7 +2090,7 @@ log_checkpoint(
recv_apply_hashed_log_recs(TRUE);
}

if (!srv_use_share && srv_unix_file_flush_method != SRV_UNIX_NOSYNC) { //ogh
if (srv_unix_file_flush_method != SRV_UNIX_NOSYNC) { //ogh
fil_flush_file_spaces(FIL_TABLESPACE);
}

Expand Down

0 comments on commit eab4e59

Please sign in to comment.