Skip to content

Commit

Permalink
MDEV-22325 ib_logfile0 is too small for innodb_thread_concurrency=0. …
Browse files Browse the repository at this point in the history
…The size of ib_logfile0 should be bigger than 200 kB * innodb_thread_concurrency.

Correct log message. IMO, we shouldn't be very precise in that
message as the formula behind it is not trivial.

Also performed a little cleanup.
  • Loading branch information
kevgs committed Jun 9, 2020
1 parent 1b01833 commit 01e8459
Show file tree
Hide file tree
Showing 3 changed files with 10 additions and 19 deletions.
6 changes: 0 additions & 6 deletions storage/innobase/include/log0log.h
Expand Up @@ -44,12 +44,6 @@ Created 12/9/1995 Heikki Tuuri

using st_::span;

/* Margin for the free space in the smallest log, before a new query
step which modifies the database, is started */

#define LOG_CHECKPOINT_FREE_PER_THREAD (4U << srv_page_size_shift)
#define LOG_CHECKPOINT_EXTRA_FREE (8U << srv_page_size_shift)

static const char LOG_FILE_NAME_PREFIX[] = "ib_logfile";
static const char LOG_FILE_NAME[] = "ib_logfile0";

Expand Down
6 changes: 0 additions & 6 deletions storage/innobase/include/log0types.h
Expand Up @@ -41,10 +41,4 @@ typedef ib_uint64_t lsn_t;

#define LSN_PF UINT64PF

/** The redo log manager */
struct RedoLog;

/** The recovery implementation */
struct redo_recover_t;

#endif /* log0types_h */
17 changes: 10 additions & 7 deletions storage/innobase/log/log0log.cc
Expand Up @@ -430,6 +430,12 @@ accommodate the number of OS threads in the database server */
bool
log_set_capacity(ulonglong file_size)
{
/* Margin for the free space in the smallest log, before a new query
step which modifies the database, is started */
const size_t LOG_CHECKPOINT_FREE_PER_THREAD = 4U
<< srv_page_size_shift;
const size_t LOG_CHECKPOINT_EXTRA_FREE = 8U << srv_page_size_shift;

lsn_t margin;
ulint free;

Expand All @@ -445,14 +451,11 @@ log_set_capacity(ulonglong file_size)
free = LOG_CHECKPOINT_FREE_PER_THREAD * (10 + srv_thread_concurrency)
+ LOG_CHECKPOINT_EXTRA_FREE;
if (free >= smallest_capacity / 2) {
ib::error() << "Cannot continue operation. " << LOG_FILE_NAME
<< " is too small for innodb_thread_concurrency="
<< srv_thread_concurrency << ". The size of "
<< LOG_FILE_NAME
<< " should be bigger than 200 kB * "
"innodb_thread_concurrency. "
ib::error() << "Cannot continue operation because log file is "
"too small. Increase innodb_log_file_size "
"or decrease innodb_thread_concurrency. "
<< INNODB_PARAMETERS_MSG;
return(false);
return false;
}

margin = smallest_capacity - free;
Expand Down

0 comments on commit 01e8459

Please sign in to comment.