Skip to content

Commit

Permalink
Rename log_make_checkpoint_at() to log_make_checkpoint()
Browse files Browse the repository at this point in the history
The function was always called with lsn=LSN_MAX.
Remove that redundant parameter.

Spotted by Thirunarayanan Balathandayuthapani.
  • Loading branch information
dr-m committed Oct 9, 2019
1 parent c65cb24 commit 6fde007
Show file tree
Hide file tree
Showing 9 changed files with 17 additions and 21 deletions.
2 changes: 1 addition & 1 deletion storage/innobase/buf/buf0dblwr.cc
Original file line number Diff line number Diff line change
Expand Up @@ -328,7 +328,7 @@ buf_dblwr_create()
mtr_commit(&mtr);

/* Flush the modified pages to disk and make a checkpoint */
log_make_checkpoint_at(LSN_MAX);
log_make_checkpoint();

/* Remove doublewrite pages from LRU */
buf_pool_invalidate();
Expand Down
2 changes: 1 addition & 1 deletion storage/innobase/handler/ha_innodb.cc
Original file line number Diff line number Diff line change
Expand Up @@ -19075,7 +19075,7 @@ checkpoint_now_set(
+ (log_sys->append_on_checkpoint != NULL
? log_sys->append_on_checkpoint->size() : 0)
< log_sys->lsn) {
log_make_checkpoint_at(LSN_MAX);
log_make_checkpoint();
fil_flush_file_spaces(FIL_TYPE_LOG);
}

Expand Down
8 changes: 3 additions & 5 deletions storage/innobase/include/log0log.h
Original file line number Diff line number Diff line change
Expand Up @@ -210,15 +210,13 @@ log_buffer_sync_in_background(
/** Make a checkpoint. Note that this function does not flush dirty
blocks from the buffer pool: it only checks what is lsn of the oldest
modification in the pool, and writes information about the lsn in
log files. Use log_make_checkpoint_at() to flush also the pool.
log files. Use log_make_checkpoint() to flush also the pool.
@param[in] sync whether to wait for the write to complete
@return true if success, false if a checkpoint write was already running */
bool log_checkpoint(bool sync);

/** Make a checkpoint at or after a specified LSN.
@param[in] lsn the log sequence number, or LSN_MAX
for the latest LSN */
void log_make_checkpoint_at(lsn_t lsn);
/** Make a checkpoint */
void log_make_checkpoint();

/****************************************************************//**
Makes a checkpoint at the latest lsn and writes it to first page of each
Expand Down
4 changes: 2 additions & 2 deletions storage/innobase/include/srv0srv.h
Original file line number Diff line number Diff line change
Expand Up @@ -656,11 +656,11 @@ do { \

#ifdef HAVE_PSI_STAGE_INTERFACE
/** Performance schema stage event for monitoring ALTER TABLE progress
everything after flush log_make_checkpoint_at(). */
everything after flush log_make_checkpoint(). */
extern PSI_stage_info srv_stage_alter_table_end;

/** Performance schema stage event for monitoring ALTER TABLE progress
log_make_checkpoint_at(). */
log_make_checkpoint(). */
extern PSI_stage_info srv_stage_alter_table_flush;

/** Performance schema stage event for monitoring ALTER TABLE progress
Expand Down
12 changes: 5 additions & 7 deletions storage/innobase/log/log0log.cc
Original file line number Diff line number Diff line change
Expand Up @@ -1553,7 +1553,7 @@ log_append_on_checkpoint(
/** Make a checkpoint. Note that this function does not flush dirty
blocks from the buffer pool: it only checks what is lsn of the oldest
modification in the pool, and writes information about the lsn in
log files. Use log_make_checkpoint_at() to flush also the pool.
log files. Use log_make_checkpoint() to flush also the pool.
@param[in] sync whether to wait for the write to complete
@return true if success, false if a checkpoint write was already running */
bool log_checkpoint(bool sync)
Expand Down Expand Up @@ -1667,14 +1667,12 @@ bool log_checkpoint(bool sync)
return(true);
}

/** Make a checkpoint at or after a specified LSN.
@param[in] lsn the log sequence number, or LSN_MAX
for the latest LSN */
void log_make_checkpoint_at(lsn_t lsn)
/** Make a checkpoint */
void log_make_checkpoint()
{
/* Preflush pages synchronously */

while (!log_preflush_pool_modified_pages(lsn)) {
while (!log_preflush_pool_modified_pages(LSN_MAX)) {
/* Flush as much as we can */
}

Expand Down Expand Up @@ -2010,7 +2008,7 @@ logs_empty_and_mark_files_at_shutdown(void)
if (!srv_read_only_mode) {
service_manager_extend_timeout(INNODB_EXTEND_TIMEOUT_INTERVAL,
"ensuring dirty buffer pool are written to log");
log_make_checkpoint_at(LSN_MAX);
log_make_checkpoint();

log_mutex_enter();

Expand Down
2 changes: 1 addition & 1 deletion storage/innobase/row/row0import.cc
Original file line number Diff line number Diff line change
Expand Up @@ -2090,7 +2090,7 @@ row_import_cleanup(

DBUG_EXECUTE_IF("ib_import_before_checkpoint_crash", DBUG_SUICIDE(););

log_make_checkpoint_at(LSN_MAX);
log_make_checkpoint();

return(err);
}
Expand Down
2 changes: 1 addition & 1 deletion storage/innobase/row/row0trunc.cc
Original file line number Diff line number Diff line change
Expand Up @@ -2224,7 +2224,7 @@ truncate_t::fixup_tables_in_non_system_tablespace()

if (err == DB_SUCCESS && s_tables.size() > 0) {

log_make_checkpoint_at(LSN_MAX);
log_make_checkpoint();
}

for (ulint i = 0; i < s_tables.size(); ++i) {
Expand Down
4 changes: 2 additions & 2 deletions storage/innobase/srv/srv0srv.cc
Original file line number Diff line number Diff line change
Expand Up @@ -669,12 +669,12 @@ static const ulint SRV_MASTER_SLOT = 0;

#ifdef HAVE_PSI_STAGE_INTERFACE
/** Performance schema stage event for monitoring ALTER TABLE progress
everything after flush log_make_checkpoint_at(). */
everything after flush log_make_checkpoint(). */
PSI_stage_info srv_stage_alter_table_end
= {0, "alter table (end)", PSI_FLAG_STAGE_PROGRESS};

/** Performance schema stage event for monitoring ALTER TABLE progress
log_make_checkpoint_at(). */
log_make_checkpoint(). */
PSI_stage_info srv_stage_alter_table_flush
= {0, "alter table (flush)", PSI_FLAG_STAGE_PROGRESS};

Expand Down
2 changes: 1 addition & 1 deletion storage/innobase/srv/srv0start.cc
Original file line number Diff line number Diff line change
Expand Up @@ -516,7 +516,7 @@ create_log_files(
(log_sys->lsn - log_sys->last_checkpoint_lsn));
log_mutex_exit();

log_make_checkpoint_at(LSN_MAX);
log_make_checkpoint();

return(DB_SUCCESS);
}
Expand Down

0 comments on commit 6fde007

Please sign in to comment.