MCPcopy Create free account
hub / github.com/Tencent/phxsql / rotate

Method rotate

phx_percona/percona/sql/binlog.cc:5657–5673  ·  view source on GitHub ↗

The method executes rotation when LOCK_log is already acquired by the caller. @param force_rotate caller can request the log rotation @param check_purge is set to true if rotation took place @note If rotation fails, for instance the server was unable to create a new log file, we still try to write an incident event to the current log. @note The caller must hold LOCK_l

Source from the content-addressed store, hash-verified

5655 nonzero - error in rotating routine.
5656*/
5657int MYSQL_BIN_LOG::rotate(bool force_rotate, bool* check_purge)
5658{
5659 int error= 0;
5660 DBUG_ENTER("MYSQL_BIN_LOG::rotate");
5661
5662 DBUG_ASSERT(!is_relay_log);
5663 mysql_mutex_assert_owner(&LOCK_log);
5664
5665 *check_purge= false;
5666
5667 if (force_rotate || (my_b_tell(&log_file) >= (my_off_t) max_size))
5668 {
5669 error= new_file_without_locking(NULL);
5670 *check_purge= true;
5671 }
5672 DBUG_RETURN(error);
5673}
5674
5675/**
5676 The method executes logs purging routine.

Callers

nothing calls this directly

Calls

no outgoing calls

Tested by

no test coverage detected