Skip to content

Commit

Permalink
MDEV-18115 remove now unneeded constraint
Browse files Browse the repository at this point in the history
log_group_max_size: is not needed because redo log do not use fil_io() now
  • Loading branch information
kevgs committed Jan 18, 2020
1 parent 744d545 commit e9de638
Show file tree
Hide file tree
Showing 5 changed files with 15 additions and 23 deletions.
3 changes: 2 additions & 1 deletion extra/mariabackup/xtrabackup.cc
Original file line number Diff line number Diff line change
Expand Up @@ -1296,7 +1296,8 @@ struct my_option xb_server_options[] =
{"innodb_log_file_size", OPT_INNODB_LOG_FILE_SIZE,
"Ignored for mysqld option compatibility",
(G_PTR*) &srv_log_file_size, (G_PTR*) &srv_log_file_size, 0,
GET_ULL, REQUIRED_ARG, 48 << 20, 1 << 20, log_group_max_size, 0,
GET_ULL, REQUIRED_ARG, 48 << 20, 1 << 20,
std::numeric_limits<ulonglong>::max(), 0,
UNIV_PAGE_SIZE_MAX, 0},
{"innodb_log_files_in_group", OPT_INNODB_LOG_FILES_IN_GROUP,
"Ignored for mysqld option compatibility",
Expand Down
9 changes: 9 additions & 0 deletions mysql-test/suite/sys_vars/r/sysvars_innodb,32bit.rdiff
Original file line number Diff line number Diff line change
Expand Up @@ -314,6 +314,15 @@
VARIABLE_COMMENT Number of log files in the log group. InnoDB writes to the files in a circular fashion.
NUMERIC_MIN_VALUE 1
NUMERIC_MAX_VALUE 100
@@ -1240,7 +1240,7 @@
VARIABLE_TYPE BIGINT UNSIGNED
VARIABLE_COMMENT Size of each log file in a log group.
NUMERIC_MIN_VALUE 1048576
-NUMERIC_MAX_VALUE 17592186044415
+NUMERIC_MAX_VALUE 18446744073709551615
NUMERIC_BLOCK_SIZE 65536
ENUM_VALUE_LIST NULL
READ_ONLY YES
@@ -1273,7 +1273,7 @@
SESSION_VALUE NULL
DEFAULT_VALUE 8192
Expand Down
14 changes: 4 additions & 10 deletions storage/innobase/handler/ha_innodb.cc
Original file line number Diff line number Diff line change
Expand Up @@ -116,6 +116,8 @@ this program; if not, write to the Free Software Foundation, Inc.,
#include "ut0mutex.h"
#include "row0ext.h"

#include <limits>

#define thd_get_trx_isolation(X) ((enum_tx_isolation)thd_tx_isolation(X))

extern "C" void thd_mark_transaction_to_rollback(MYSQL_THD thd, bool all);
Expand Down Expand Up @@ -3709,15 +3711,6 @@ static int innodb_init_params()
DBUG_RETURN(HA_ERR_INITIALIZATION);
}

if (srv_n_log_files * srv_log_file_size >= log_group_max_size) {
/* Log group size is limited by the size of page number.
Remove this limitation when fil_io() is not used for
recovery log io. */
ib::error() << "Combined size of log files must be < "
<< log_group_max_size;
DBUG_RETURN(HA_ERR_INITIALIZATION);
}

DBUG_ASSERT(innodb_change_buffering <= IBUF_USE_ALL);

/* Check that interdependent parameters have sane values. */
Expand Down Expand Up @@ -19725,7 +19718,8 @@ static MYSQL_SYSVAR_ULONG(log_buffer_size, srv_log_buffer_size,
static MYSQL_SYSVAR_ULONGLONG(log_file_size, srv_log_file_size,
PLUGIN_VAR_RQCMDARG | PLUGIN_VAR_READONLY,
"Size of each log file in a log group.",
NULL, NULL, 96 << 20, 1 << 20, log_group_max_size, UNIV_PAGE_SIZE_MAX);
NULL, NULL, 96 << 20, 1 << 20, std::numeric_limits<ulonglong>::max(),
UNIV_PAGE_SIZE_MAX);
/* OS_FILE_LOG_BLOCK_SIZE would be more appropriate than UNIV_PAGE_SIZE_MAX,
but fil_space_t is being used for the redo log, and it uses data pages. */

Expand Down
10 changes: 0 additions & 10 deletions storage/innobase/include/log0log.h
Original file line number Diff line number Diff line change
Expand Up @@ -43,10 +43,6 @@ Created 12/9/1995 Heikki Tuuri

using st_::span;

#ifndef UINT32_MAX
#define UINT32_MAX (4294967295U)
#endif

/** Maximum number of srv_n_log_files, or innodb_log_files_in_group */
#define SRV_N_LOG_FILES_MAX 100

Expand Down Expand Up @@ -449,12 +445,6 @@ or the MySQL version that created the redo log file. */
header */
#define LOG_FILE_HDR_SIZE (4 * OS_FILE_LOG_BLOCK_SIZE)

/* As long as fil_io() is used to handle log io, log group max size is limited
by (maximum page number) * (minimum page size). Page number type is uint32_t.
Remove this limitation if page number is no longer used for log file io. */
static const ulonglong log_group_max_size =
((ulonglong(UINT32_MAX) + 1) * UNIV_PAGE_SIZE_MIN - 1);

typedef ib_mutex_t LogSysMutex;
typedef ib_mutex_t FlushOrderMutex;

Expand Down
2 changes: 0 additions & 2 deletions storage/innobase/srv/srv0start.cc
Original file line number Diff line number Diff line change
Expand Up @@ -1597,8 +1597,6 @@ dberr_t srv_start(bool create_new_db)

srv_n_log_files_found = i;

ut_a(srv_log_file_size <= log_group_max_size);

std::vector<std::string> file_names;

for (unsigned j = 0; j < srv_n_log_files_found; j++) {
Expand Down

0 comments on commit e9de638

Please sign in to comment.