MDEV-22721 Remove bloat caused by InnoDB logger class

Introduce a new ATTRIBUTE_NOINLINE to
ib::logger member functions, and add UNIV_UNLIKELY hints to callers.

Also, remove some crash reporting output. If needed, the
information will be available using debugging tools.

Furthermore, remove some fts_enable_diag_print output that included
indexed words in raw form. The code seemed to assume that words are
NUL-terminated byte strings. It is not clear whether a NUL terminator
is always guaranteed to be present. Also, UCS2 or UTF-16 strings would
typically contain many NUL bytes.
This commit is contained in:
Marko Mäkelä 2020-06-04 10:24:10 +03:00
parent ad2bf1129c
commit eba2d10ac5
38 changed files with 227 additions and 326 deletions

View file

@ -2,6 +2,7 @@
#define MY_COMPILER_INCLUDED #define MY_COMPILER_INCLUDED
/* Copyright (c) 2010, 2011, Oracle and/or its affiliates. All rights reserved. /* Copyright (c) 2010, 2011, Oracle and/or its affiliates. All rights reserved.
Copyright (c) 2017, 2020, MariaDB Corporation.
This program is free software; you can redistribute it and/or modify This program is free software; you can redistribute it and/or modify
it under the terms of the GNU General Public License as published by it under the terms of the GNU General Public License as published by
@ -150,6 +151,7 @@ struct my_aligned_storage
#ifdef __GNUC__ #ifdef __GNUC__
# define ATTRIBUTE_NORETURN __attribute__((noreturn)) # define ATTRIBUTE_NORETURN __attribute__((noreturn))
# define ATTRIBUTE_NOINLINE __attribute__((noinline))
# if MY_GNUC_PREREQ(4,3) # if MY_GNUC_PREREQ(4,3)
/** Starting with GCC 4.3, the "cold" attribute is used to inform the /** Starting with GCC 4.3, the "cold" attribute is used to inform the
compiler that a function is unlikely executed. The function is compiler that a function is unlikely executed. The function is
@ -163,8 +165,10 @@ rarely invoked function for size instead for speed. */
# endif # endif
#elif defined _MSC_VER #elif defined _MSC_VER
# define ATTRIBUTE_NORETURN __declspec(noreturn) # define ATTRIBUTE_NORETURN __declspec(noreturn)
# define ATTRIBUTE_NOINLINE __declspec(noinline)
#else #else
# define ATTRIBUTE_NORETURN /* empty */ # define ATTRIBUTE_NORETURN /* empty */
# define ATTRIBUTE_NOINLINE /* empty */
#endif #endif
#ifndef ATTRIBUTE_COLD #ifndef ATTRIBUTE_COLD

View file

@ -3725,9 +3725,9 @@ lookup:
ut_ad(!hash_lock); ut_ad(!hash_lock);
dberr_t err = buf_read_page(page_id, page_size); dberr_t err = buf_read_page(page_id, page_size);
if (err != DB_SUCCESS) { if (UNIV_UNLIKELY(err != DB_SUCCESS)) {
ib::error() << "Reading compressed page " << page_id ib::error() << "Reading compressed page " << page_id
<< " failed with error: " << ut_strerr(err); << " failed with error: " << err;
goto err_exit; goto err_exit;
} }
@ -5250,7 +5250,8 @@ buf_page_init(
if (hash_page == NULL) { if (hash_page == NULL) {
/* Block not found in hash table */ /* Block not found in hash table */
} else if (buf_pool_watch_is_sentinel(buf_pool, hash_page)) { } else if (UNIV_LIKELY(buf_pool_watch_is_sentinel(buf_pool,
hash_page))) {
/* Preserve the reference count. */ /* Preserve the reference count. */
ib_uint32_t buf_fix_count = hash_page->buf_fix_count; ib_uint32_t buf_fix_count = hash_page->buf_fix_count;
@ -5260,18 +5261,8 @@ buf_page_init(
buf_pool_watch_remove(buf_pool, hash_page); buf_pool_watch_remove(buf_pool, hash_page);
} else { } else {
ib::fatal() << "Page already foudn in the hash table: "
ib::error() << "Page " << page_id << page_id;
<< " already found in the hash table: "
<< hash_page << ", " << block;
ut_d(buf_page_mutex_exit(block));
ut_d(buf_pool_mutex_exit(buf_pool));
ut_d(buf_print());
ut_d(buf_LRU_print());
ut_d(buf_validate());
ut_d(buf_LRU_validate());
ut_error;
} }
ut_ad(!block->page.in_zip_hash); ut_ad(!block->page.in_zip_hash);
@ -7253,6 +7244,7 @@ operator<<(
return(out); return(out);
} }
#if defined UNIV_DEBUG_PRINT || defined UNIV_DEBUG || defined UNIV_BUF_DEBUG
/** Print the given buf_pool_t object. /** Print the given buf_pool_t object.
@param[in,out] out the output stream @param[in,out] out the output stream
@param[in] buf_pool the buf_pool_t object to be printed @param[in] buf_pool the buf_pool_t object to be printed
@ -7280,6 +7272,7 @@ operator<<(
<< ", written=" << buf_pool.stat.n_pages_written << "]"; << ", written=" << buf_pool.stat.n_pages_written << "]";
return(out); return(out);
} }
#endif /* UNIV_DEBUG_PRINT || UNIV_DEBUG || UNIV_BUF_DEBUG */
/** Encrypt a buffer of temporary tablespace /** Encrypt a buffer of temporary tablespace
@param[in] offset Page offset @param[in] offset Page offset

View file

@ -600,11 +600,11 @@ buf_dblwr_process()
page_id, page_size, page_id, page_size,
0, page_size.physical(), read_buf, NULL); 0, page_size.physical(), read_buf, NULL);
if (err != DB_SUCCESS) { if (UNIV_UNLIKELY(err != DB_SUCCESS)) {
ib::warn() ib::warn()
<< "Double write buffer recovery: " << "Double write buffer recovery: "
<< page_id << " read failed with " << page_id << " read failed with "
<< "error: " << ut_strerr(err); << "error: " << err;
} }
const bool is_all_zero = buf_is_zeroes( const bool is_all_zero = buf_is_zeroes(

View file

@ -578,18 +578,11 @@ buf_flush_ready_for_replace(
#endif /* UNIV_DEBUG */ #endif /* UNIV_DEBUG */
ut_ad(mutex_own(buf_page_get_mutex(bpage))); ut_ad(mutex_own(buf_page_get_mutex(bpage)));
ut_ad(bpage->in_LRU_list); ut_ad(bpage->in_LRU_list);
ut_a(buf_page_in_file(bpage));
if (buf_page_in_file(bpage)) { return bpage->oldest_modification == 0
&& bpage->buf_fix_count == 0
return(bpage->oldest_modification == 0 && buf_page_get_io_fix(bpage) == BUF_IO_NONE;
&& bpage->buf_fix_count == 0
&& buf_page_get_io_fix(bpage) == BUF_IO_NONE);
}
ib::fatal() << "Buffer block " << bpage << " state " << bpage->state
<< " in the LRU list!";
return(FALSE);
} }
/********************************************************************//** /********************************************************************//**

View file

@ -1824,46 +1824,9 @@ buf_LRU_block_remove_hashed(
} }
hashed_bpage = buf_page_hash_get_low(buf_pool, bpage->id); hashed_bpage = buf_page_hash_get_low(buf_pool, bpage->id);
if (bpage != hashed_bpage) { if (UNIV_UNLIKELY(bpage != hashed_bpage)) {
ib::error() << "Page " << bpage->id ib::fatal() << "Page not found in the hash table: "
<< " not found in the hash table"; << bpage->id;
#ifdef UNIV_DEBUG
ib::error()
<< "in_page_hash:" << bpage->in_page_hash
<< " in_zip_hash:" << bpage->in_zip_hash
// << " in_free_list:"<< bpage->in_fee_list
<< " in_flush_list:" << bpage->in_flush_list
<< " in_LRU_list:" << bpage->in_LRU_list
<< " zip.data:" << bpage->zip.data
<< " zip_size:" << bpage->size.logical()
<< " page_state:" << buf_page_get_state(bpage);
#else
ib::error()
<< " zip.data:" << bpage->zip.data
<< " zip_size:" << bpage->size.logical()
<< " page_state:" << buf_page_get_state(bpage);
#endif
if (hashed_bpage) {
ib::error() << "In hash table we find block "
<< hashed_bpage << " of " << hashed_bpage->id
<< " which is not " << bpage;
}
#if defined UNIV_DEBUG || defined UNIV_BUF_DEBUG
mutex_exit(buf_page_get_mutex(bpage));
rw_lock_x_unlock(hash_lock);
buf_pool_mutex_exit(buf_pool);
buf_print();
buf_LRU_print();
buf_validate();
buf_LRU_validate();
#endif /* UNIV_DEBUG || UNIV_BUF_DEBUG */
ut_error;
} }
ut_ad(!bpage->in_zip_hash); ut_ad(!bpage->in_zip_hash);

View file

@ -1719,10 +1719,9 @@ dict_create_or_check_foreign_constraint_tables(void)
"END;\n", "END;\n",
FALSE, trx); FALSE, trx);
if (err != DB_SUCCESS) { if (UNIV_UNLIKELY(err != DB_SUCCESS)) {
ib::error() << "Creation of SYS_FOREIGN and SYS_FOREIGN_COLS" ib::error() << "Creation of SYS_FOREIGN and SYS_FOREIGN_COLS"
" failed: " << ut_strerr(err) << ". Tablespace is" " failed: " << err << ". Tablespace is"
" full. Dropping incompletely created tables."; " full. Dropping incompletely created tables.";
ut_ad(err == DB_OUT_OF_FILE_SPACE ut_ad(err == DB_OUT_OF_FILE_SPACE
@ -1821,10 +1820,9 @@ dict_create_or_check_sys_virtual()
"END;\n", "END;\n",
FALSE, trx); FALSE, trx);
if (err != DB_SUCCESS) { if (UNIV_UNLIKELY(err != DB_SUCCESS)) {
ib::error() << "Creation of SYS_VIRTUAL" ib::error() << "Creation of SYS_VIRTUAL"
" failed: " << ut_strerr(err) << ". Tablespace is" " failed: " << err << ". Tablespace is"
" full or too many transactions." " full or too many transactions."
" Dropping incompletely created tables."; " Dropping incompletely created tables.";
@ -1902,9 +1900,9 @@ dict_foreign_eval_sql(
return(error); return(error);
} }
if (error != DB_SUCCESS) { if (UNIV_UNLIKELY(error != DB_SUCCESS)) {
ib::error() << "Foreign key constraint creation failed: " ib::error() << "Foreign key constraint creation failed: "
<< ut_strerr(error); << error;
mutex_enter(&dict_foreign_err_mutex); mutex_enter(&dict_foreign_err_mutex);
ut_print_timestamp(ef); ut_print_timestamp(ef);
@ -2353,10 +2351,9 @@ dict_create_or_check_sys_tablespace(void)
"END;\n", "END;\n",
FALSE, trx); FALSE, trx);
if (err != DB_SUCCESS) { if (UNIV_UNLIKELY(err != DB_SUCCESS)) {
ib::error() << "Creation of SYS_TABLESPACES and SYS_DATAFILES" ib::error() << "Creation of SYS_TABLESPACES and SYS_DATAFILES"
" has failed with error " << ut_strerr(err) " has failed with error " << err
<< ". Dropping incompletely created tables."; << ". Dropping incompletely created tables.";
ut_a(err == DB_OUT_OF_FILE_SPACE ut_a(err == DB_OUT_OF_FILE_SPACE

View file

@ -925,7 +925,7 @@ dict_update_filepath(
trx->dict_operation_lock_mode = 0; trx->dict_operation_lock_mode = 0;
trx_free_for_background(trx); trx_free_for_background(trx);
if (err == DB_SUCCESS) { if (UNIV_LIKELY(err == DB_SUCCESS)) {
/* We just updated SYS_DATAFILES due to the contents in /* We just updated SYS_DATAFILES due to the contents in
a link file. Make a note that we did this. */ a link file. Make a note that we did this. */
ib::info() << "The InnoDB data dictionary table SYS_DATAFILES" ib::info() << "The InnoDB data dictionary table SYS_DATAFILES"
@ -935,7 +935,7 @@ dict_update_filepath(
ib::warn() << "Error occurred while updating InnoDB data" ib::warn() << "Error occurred while updating InnoDB data"
" dictionary table SYS_DATAFILES for tablespace ID " " dictionary table SYS_DATAFILES for tablespace ID "
<< space_id << " to file " << filepath << ": " << space_id << " to file " << filepath << ": "
<< ut_strerr(err) << "."; << err << ".";
} }
return(err); return(err);

View file

@ -2355,14 +2355,14 @@ dict_stats_save_index_stat(
");\n" ");\n"
"END;", trx); "END;", trx);
if (ret != DB_SUCCESS) { if (UNIV_UNLIKELY(ret != DB_SUCCESS)) {
if (innodb_index_stats_not_found == false && if (innodb_index_stats_not_found == false &&
index->stats_error_printed == false) { index->stats_error_printed == false) {
ib::error() << "Cannot save index statistics for table " ib::error() << "Cannot save index statistics for table "
<< index->table->name << index->table->name
<< ", index " << index->name << ", index " << index->name
<< ", stat name \"" << stat_name << "\": " << ", stat name \"" << stat_name << "\": "
<< ut_strerr(ret); << ret;
index->stats_error_printed = true; index->stats_error_printed = true;
} }
} }
@ -2473,9 +2473,9 @@ dict_stats_save(
");\n" ");\n"
"END;", NULL); "END;", NULL);
if (ret != DB_SUCCESS) { if (UNIV_UNLIKELY(ret != DB_SUCCESS)) {
ib::error() << "Cannot save table statistics for table " ib::error() << "Cannot save table statistics for table "
<< table->name << ": " << ut_strerr(ret); << table->name << ": " << ret;
mutex_exit(&dict_sys->mutex); mutex_exit(&dict_sys->mutex);
rw_lock_x_unlock(&dict_operation_lock); rw_lock_x_unlock(&dict_operation_lock);
@ -3330,7 +3330,7 @@ dict_stats_update(
" for table " " for table "
<< table->name << table->name
<< " from " TABLE_STATS_NAME_PRINT " and " << " from " TABLE_STATS_NAME_PRINT " and "
INDEX_STATS_NAME_PRINT ": " << ut_strerr(err) INDEX_STATS_NAME_PRINT ": " << err
<< ". Using transient stats method instead."; << ". Using transient stats method instead.";
} }

View file

@ -298,14 +298,9 @@ fil_space_read_crypt_data(const page_size_t& page_size, const byte* page)
type == CRYPT_SCHEME_1) type == CRYPT_SCHEME_1)
|| iv_length != sizeof crypt_data->iv) { || iv_length != sizeof crypt_data->iv) {
ib::error() << "Found non sensible crypt scheme: " ib::error() << "Found non sensible crypt scheme: "
<< type << "," << iv_length << " for space: " << type << "," << iv_length
<< page_get_space_id(page) << " offset: " << " for space: "
<< offset << " bytes: [" << page_get_space_id(page);
<< page[offset + 2 + MAGIC_SZ]
<< page[offset + 3 + MAGIC_SZ]
<< page[offset + 4 + MAGIC_SZ]
<< page[offset + 5 + MAGIC_SZ]
<< "].";
return NULL; return NULL;
} }
@ -725,8 +720,10 @@ fil_space_decrypt(
} }
ib::fatal() << "Unable to decrypt data-block " ib::fatal() << "Unable to decrypt data-block "
<< " src: " << src << "srclen: " << " src: " << static_cast<const void*>(src)
<< srclen << " buf: " << dst << "buflen: " << "srclen: "
<< srclen << " buf: "
<< static_cast<const void*>(dst) << "buflen: "
<< dstlen << " return-code: " << rc << dstlen << " return-code: " << rc
<< " Can't continue!"; << " Can't continue!";
} }

View file

@ -3228,12 +3228,12 @@ fil_discard_tablespace(
case DB_IO_ERROR: case DB_IO_ERROR:
ib::warn() << "While deleting tablespace " << id ib::warn() << "While deleting tablespace " << id
<< " in DISCARD TABLESPACE. File rename/delete" << " in DISCARD TABLESPACE. File rename/delete"
" failed: " << ut_strerr(err); " failed: " << err;
break; break;
case DB_TABLESPACE_NOT_FOUND: case DB_TABLESPACE_NOT_FOUND:
ib::warn() << "Cannot delete tablespace " << id ib::warn() << "Cannot delete tablespace " << id
<< " in DISCARD TABLESPACE: " << ut_strerr(err); << " in DISCARD TABLESPACE: " << err;
break; break;
default: default:
@ -5177,7 +5177,7 @@ fil_aio_wait(
ib::error() << "Failed to read file '" ib::error() << "Failed to read file '"
<< node->name << node->name
<< "' at offset " << offset << "' at offset " << offset
<< ": " << ut_strerr(err); << ": " << err;
} }
fil_space_release_for_io(space); fil_space_release_for_io(space);

View file

@ -1,7 +1,7 @@
/***************************************************************************** /*****************************************************************************
Copyright (c) 2013, 2016, Oracle and/or its affiliates. All Rights Reserved. Copyright (c) 2013, 2016, Oracle and/or its affiliates. All Rights Reserved.
Copyright (c) 2017, 2018, MariaDB Corporation. Copyright (c) 2017, 2020, MariaDB Corporation.
This program is free software; you can redistribute it and/or modify it under This program is free software; you can redistribute it and/or modify it under
the terms of the GNU General Public License as published by the Free Software the terms of the GNU General Public License as published by the Free Software
@ -331,7 +331,7 @@ Datafile::read_first_page(bool read_only_mode)
ib::error() ib::error()
<< "Cannot read first page of '" << "Cannot read first page of '"
<< m_filepath << "' " << m_filepath << "' "
<< ut_strerr(err); << err;
break; break;
} }
} }

View file

@ -1437,7 +1437,7 @@ fsp_alloc_free_page(
ut_a(!is_system_tablespace(space_id)); ut_a(!is_system_tablespace(space_id));
if (page_no >= FSP_EXTENT_SIZE) { if (page_no >= FSP_EXTENT_SIZE) {
ib::error() << "Trying to extend a single-table" ib::error() << "Trying to extend a single-table"
" tablespace " << space << " , by single" " tablespace " << space->name << " , by single"
" page(s) though the space size " << space_size " page(s) though the space size " << space_size
<< ". Page no " << page_no << "."; << ". Page no " << page_no << ".";
return(NULL); return(NULL);

View file

@ -1,7 +1,7 @@
/***************************************************************************** /*****************************************************************************
Copyright (c) 2007, 2016, Oracle and/or its affiliates. All Rights Reserved. Copyright (c) 2007, 2016, Oracle and/or its affiliates. All Rights Reserved.
Copyright (c) 2017, 2019, MariaDB Corporation. Copyright (c) 2017, 2020, MariaDB Corporation.
This program is free software; you can redistribute it and/or modify it under This program is free software; you can redistribute it and/or modify it under
the terms of the GNU General Public License as published by the Free Software the terms of the GNU General Public License as published by the Free Software
@ -317,9 +317,7 @@ fts_config_get_index_ulint(
error = fts_config_get_index_value(trx, index, name, &value); error = fts_config_get_index_value(trx, index, name, &value);
if (UNIV_UNLIKELY(error != DB_SUCCESS)) { if (UNIV_UNLIKELY(error != DB_SUCCESS)) {
ib::error() << "(" << error << ") reading `" << name << "'";
ib::error() << "(" << ut_strerr(error) << ") reading `"
<< name << "'";
} else { } else {
*int_value = strtoul((char*) value.f_str, NULL, 10); *int_value = strtoul((char*) value.f_str, NULL, 10);
} }
@ -357,9 +355,7 @@ fts_config_set_index_ulint(
error = fts_config_set_index_value(trx, index, name, &value); error = fts_config_set_index_value(trx, index, name, &value);
if (UNIV_UNLIKELY(error != DB_SUCCESS)) { if (UNIV_UNLIKELY(error != DB_SUCCESS)) {
ib::error() << "(" << error << ") writing `" << name << "'";
ib::error() << "(" << ut_strerr(error) << ") writing `"
<< name << "'";
} }
ut_free(value.f_str); ut_free(value.f_str);
@ -391,8 +387,7 @@ fts_config_get_ulint(
error = fts_config_get_value(trx, fts_table, name, &value); error = fts_config_get_value(trx, fts_table, name, &value);
if (UNIV_UNLIKELY(error != DB_SUCCESS)) { if (UNIV_UNLIKELY(error != DB_SUCCESS)) {
ib::error() << "(" << ut_strerr(error) << ") reading `" ib::error() << "(" << error << ") reading `" << name << "'";
<< name << "'";
} else { } else {
*int_value = strtoul((char*) value.f_str, NULL, 10); *int_value = strtoul((char*) value.f_str, NULL, 10);
} }
@ -430,8 +425,7 @@ fts_config_set_ulint(
error = fts_config_set_value(trx, fts_table, name, &value); error = fts_config_set_value(trx, fts_table, name, &value);
if (UNIV_UNLIKELY(error != DB_SUCCESS)) { if (UNIV_UNLIKELY(error != DB_SUCCESS)) {
ib::error() << "(" << ut_strerr(error) << ") writing `" ib::error() << "(" << error << ") writing `" << name << "'";
<< name << "'";
} }
ut_free(value.f_str); ut_free(value.f_str);

View file

@ -510,7 +510,7 @@ cleanup:
for (;;) { for (;;) {
dberr_t error = fts_eval_sql(trx, graph); dberr_t error = fts_eval_sql(trx, graph);
if (error == DB_SUCCESS) { if (UNIV_LIKELY(error == DB_SUCCESS)) {
fts_sql_commit(trx); fts_sql_commit(trx);
stopword_info->status = STOPWORD_USER_TABLE; stopword_info->status = STOPWORD_USER_TABLE;
break; break;
@ -523,7 +523,7 @@ cleanup:
trx->error_state = DB_SUCCESS; trx->error_state = DB_SUCCESS;
} else { } else {
ib::error() << "Error '" << ut_strerr(error) ib::error() << "Error '" << error
<< "' while reading user stopword" << "' while reading user stopword"
" table."; " table.";
ret = FALSE; ret = FALSE;
@ -1454,9 +1454,9 @@ fts_drop_table(
error = row_drop_table_for_mysql(table_name, trx, error = row_drop_table_for_mysql(table_name, trx,
SQLCOM_DROP_DB, false, false); SQLCOM_DROP_DB, false, false);
if (error != DB_SUCCESS) { if (UNIV_UNLIKELY(error != DB_SUCCESS)) {
ib::error() << "Unable to drop FTS index aux table " ib::error() << "Unable to drop FTS index aux table "
<< table_name << ": " << ut_strerr(error); << table_name << ": " << error;
} }
} else { } else {
error = DB_FAIL; error = DB_FAIL;
@ -2535,8 +2535,7 @@ fts_get_max_cache_size(
error = fts_config_get_value( error = fts_config_get_value(
trx, fts_table, FTS_MAX_CACHE_SIZE_IN_MB, &value); trx, fts_table, FTS_MAX_CACHE_SIZE_IN_MB, &value);
if (error == DB_SUCCESS) { if (UNIV_LIKELY(error == DB_SUCCESS)) {
value.f_str[value.f_len] = 0; value.f_str[value.f_len] = 0;
cache_size_in_mb = strtoul((char*) value.f_str, NULL, 10); cache_size_in_mb = strtoul((char*) value.f_str, NULL, 10);
@ -2566,7 +2565,7 @@ fts_get_max_cache_size(
cache_size_in_mb = FTS_CACHE_SIZE_LOWER_LIMIT_IN_MB; cache_size_in_mb = FTS_CACHE_SIZE_LOWER_LIMIT_IN_MB;
} }
} else { } else {
ib::error() << "(" << ut_strerr(error) << ") reading max" ib::error() << "(" << error << ") reading max"
" cache config value from config table"; " cache config value from config table";
} }
@ -2735,13 +2734,12 @@ retry:
func_exit: func_exit:
if (error == DB_SUCCESS) { if (UNIV_LIKELY(error == DB_SUCCESS)) {
fts_sql_commit(trx); fts_sql_commit(trx);
} else { } else {
*doc_id = 0; *doc_id = 0;
ib::error() << "(" << ut_strerr(error) << ") while getting" ib::error() << "(" << error << ") while getting next doc id.";
" next doc id.";
fts_sql_rollback(trx); fts_sql_rollback(trx);
if (error == DB_DEADLOCK) { if (error == DB_DEADLOCK) {
@ -2816,12 +2814,11 @@ fts_update_sync_doc_id(
fts_que_graph_free_check_lock(&fts_table, NULL, graph); fts_que_graph_free_check_lock(&fts_table, NULL, graph);
if (local_trx) { if (local_trx) {
if (error == DB_SUCCESS) { if (UNIV_LIKELY(error == DB_SUCCESS)) {
fts_sql_commit(trx); fts_sql_commit(trx);
cache->synced_doc_id = doc_id; cache->synced_doc_id = doc_id;
} else { } else {
ib::error() << "(" << error << ") while"
ib::error() << "(" << ut_strerr(error) << ") while"
" updating last doc id."; " updating last doc id.";
fts_sql_rollback(trx); fts_sql_rollback(trx);
@ -4065,14 +4062,14 @@ fts_sync_write_words(
n_nodes += ib_vector_size(word->nodes); n_nodes += ib_vector_size(word->nodes);
if (error != DB_SUCCESS && !print_error) { if (UNIV_UNLIKELY(error != DB_SUCCESS) && !print_error) {
ib::error() << "(" << ut_strerr(error) << ") writing" ib::error() << "(" << error << ") writing"
" word node to FTS auxiliary index table."; " word node to FTS auxiliary index table.";
print_error = TRUE; print_error = TRUE;
} }
} }
if (fts_enable_diag_print) { if (UNIV_UNLIKELY(fts_enable_diag_print)) {
printf("Avg number of nodes: %lf\n", printf("Avg number of nodes: %lf\n",
(double) n_nodes / (double) (n_words > 1 ? n_words : 1)); (double) n_nodes / (double) (n_words > 1 ? n_words : 1));
} }
@ -4098,7 +4095,7 @@ fts_sync_begin(
sync->trx = trx_allocate_for_background(); sync->trx = trx_allocate_for_background();
trx_start_internal(sync->trx); trx_start_internal(sync->trx);
if (fts_enable_diag_print) { if (UNIV_UNLIKELY(fts_enable_diag_print)) {
ib::info() << "FTS SYNC for table " << sync->table->name ib::info() << "FTS SYNC for table " << sync->table->name
<< ", deleted count: " << ", deleted count: "
<< ib_vector_size(cache->deleted_doc_ids) << ib_vector_size(cache->deleted_doc_ids)
@ -4121,7 +4118,7 @@ fts_sync_index(
trx->op_info = "doing SYNC index"; trx->op_info = "doing SYNC index";
if (fts_enable_diag_print) { if (UNIV_UNLIKELY(fts_enable_diag_print)) {
ib::info() << "SYNC words: " << rbt_size(index_cache->words); ib::info() << "SYNC words: " << rbt_size(index_cache->words);
} }
@ -4218,18 +4215,14 @@ fts_sync_commit(
fts_cache_init(cache); fts_cache_init(cache);
rw_lock_x_unlock(&cache->lock); rw_lock_x_unlock(&cache->lock);
if (error == DB_SUCCESS) { if (UNIV_LIKELY(error == DB_SUCCESS)) {
fts_sql_commit(trx); fts_sql_commit(trx);
} else {
} else if (error != DB_SUCCESS) {
fts_sql_rollback(trx); fts_sql_rollback(trx);
ib::error() << "(" << error << ") during SYNC.";
ib::error() << "(" << ut_strerr(error) << ") during SYNC.";
} }
if (fts_enable_diag_print && elapsed_time) { if (UNIV_UNLIKELY(fts_enable_diag_print) && elapsed_time) {
ib::info() << "SYNC for table " << sync->table->name ib::info() << "SYNC for table " << sync->table->name
<< ": SYNC time: " << ": SYNC time: "
<< (time(NULL) - sync->start_time) << (time(NULL) - sync->start_time)
@ -4983,7 +4976,7 @@ fts_get_rows_count(
for (;;) { for (;;) {
error = fts_eval_sql(trx, graph); error = fts_eval_sql(trx, graph);
if (error == DB_SUCCESS) { if (UNIV_LIKELY(error == DB_SUCCESS)) {
fts_sql_commit(trx); fts_sql_commit(trx);
break; /* Exit the loop. */ break; /* Exit the loop. */
@ -4996,7 +4989,7 @@ fts_get_rows_count(
trx->error_state = DB_SUCCESS; trx->error_state = DB_SUCCESS;
} else { } else {
ib::error() << "(" << ut_strerr(error) ib::error() << "(" << error
<< ") while reading FTS table."; << ") while reading FTS table.";
break; /* Exit the loop. */ break; /* Exit the loop. */
@ -7061,7 +7054,7 @@ fts_drop_orphaned_tables(void)
for (;;) { for (;;) {
error = fts_eval_sql(trx, graph); error = fts_eval_sql(trx, graph);
if (error == DB_SUCCESS) { if (UNIV_LIKELY(error == DB_SUCCESS)) {
fts_check_and_drop_orphaned_tables(trx, tables); fts_check_and_drop_orphaned_tables(trx, tables);
break; /* Exit the loop. */ break; /* Exit the loop. */
} else { } else {
@ -7075,7 +7068,7 @@ fts_drop_orphaned_tables(void)
trx->error_state = DB_SUCCESS; trx->error_state = DB_SUCCESS;
} else { } else {
ib::error() << "(" << ut_strerr(error) ib::error() << "(" << error
<< ") while reading SYS_TABLES."; << ") while reading SYS_TABLES.";
break; /* Exit the loop. */ break; /* Exit the loop. */

View file

@ -525,7 +525,7 @@ fts_index_fetch_nodes(
for (;;) { for (;;) {
error = fts_eval_sql(trx, *graph); error = fts_eval_sql(trx, *graph);
if (error == DB_SUCCESS) { if (UNIV_LIKELY(error == DB_SUCCESS)) {
fts_sql_commit(trx); fts_sql_commit(trx);
break; /* Exit the loop. */ break; /* Exit the loop. */
@ -538,7 +538,7 @@ fts_index_fetch_nodes(
trx->error_state = DB_SUCCESS; trx->error_state = DB_SUCCESS;
} else { } else {
ib::error() << "(" << ut_strerr(error) ib::error() << "(" << error
<< ") while reading FTS index."; << ") while reading FTS index.";
break; /* Exit the loop. */ break; /* Exit the loop. */
@ -860,7 +860,7 @@ fts_index_fetch_words(
error = fts_eval_sql(optim->trx, graph); error = fts_eval_sql(optim->trx, graph);
} }
if (error == DB_SUCCESS) { if (UNIV_LIKELY(error == DB_SUCCESS)) {
//FIXME fts_sql_commit(optim->trx); //FIXME fts_sql_commit(optim->trx);
break; break;
} else { } else {
@ -877,7 +877,7 @@ fts_index_fetch_words(
optim->trx->error_state = DB_SUCCESS; optim->trx->error_state = DB_SUCCESS;
} else { } else {
ib::error() << "(" << ut_strerr(error) ib::error() << "(" << error
<< ") while reading document."; << ") while reading document.";
break; /* Exit the loop. */ break; /* Exit the loop. */
@ -1356,12 +1356,6 @@ fts_optimize_word(
enc.src_last_doc_id = 0; enc.src_last_doc_id = 0;
enc.src_ilist_ptr = NULL; enc.src_ilist_ptr = NULL;
if (fts_enable_diag_print) {
word->text.f_str[word->text.f_len] = 0;
ib::info() << "FTS_OPTIMIZE: optimize \"" << word->text.f_str
<< "\"";
}
while (i < size) { while (i < size) {
ulint copied; ulint copied;
fts_node_t* src_node; fts_node_t* src_node;
@ -1439,11 +1433,6 @@ fts_optimize_write_word(
ut_ad(fts_table->charset); ut_ad(fts_table->charset);
if (fts_enable_diag_print) {
ib::info() << "FTS_OPTIMIZE: processed \"" << word->f_str
<< "\"";
}
pars_info_bind_varchar_literal( pars_info_bind_varchar_literal(
info, "word", word->f_str, word->f_len); info, "word", word->f_str, word->f_len);
@ -1461,8 +1450,8 @@ fts_optimize_write_word(
error = fts_eval_sql(trx, graph); error = fts_eval_sql(trx, graph);
if (error != DB_SUCCESS) { if (UNIV_UNLIKELY(error != DB_SUCCESS)) {
ib::error() << "(" << ut_strerr(error) << ") during optimize," ib::error() << "(" << error << ") during optimize,"
" when deleting a word from the FTS index."; " when deleting a word from the FTS index.";
} }
@ -1485,8 +1474,8 @@ fts_optimize_write_word(
error = fts_write_node( error = fts_write_node(
trx, &graph, fts_table, word, node); trx, &graph, fts_table, word, node);
if (error != DB_SUCCESS) { if (UNIV_UNLIKELY(error != DB_SUCCESS)) {
ib::error() << "(" << ut_strerr(error) << ")" ib::error() << "(" << error << ")"
" during optimize, while adding a" " during optimize, while adding a"
" word to the FTS index."; " word to the FTS index.";
} }
@ -1875,9 +1864,8 @@ fts_optimize_index_completed(
error = fts_config_set_index_value( error = fts_config_set_index_value(
optim->trx, index, FTS_LAST_OPTIMIZED_WORD, &word); optim->trx, index, FTS_LAST_OPTIMIZED_WORD, &word);
if (error != DB_SUCCESS) { if (UNIV_UNLIKELY(error != DB_SUCCESS)) {
ib::error() << "(" << error << ") while updating"
ib::error() << "(" << ut_strerr(error) << ") while updating"
" last optimized word!"; " last optimized word!";
} }
@ -2429,7 +2417,7 @@ fts_optimize_table(
fts_optimize_t* optim = NULL; fts_optimize_t* optim = NULL;
fts_t* fts = table->fts; fts_t* fts = table->fts;
if (fts_enable_diag_print) { if (UNIV_UNLIKELY(fts_enable_diag_print)) {
ib::info() << "FTS start optimize " << table->name; ib::info() << "FTS start optimize " << table->name;
} }
@ -2481,7 +2469,7 @@ fts_optimize_table(
if (error == DB_SUCCESS if (error == DB_SUCCESS
&& optim->n_completed == ib_vector_size(fts->indexes)) { && optim->n_completed == ib_vector_size(fts->indexes)) {
if (fts_enable_diag_print) { if (UNIV_UNLIKELY(fts_enable_diag_print)) {
ib::info() << "FTS_OPTIMIZE: Completed" ib::info() << "FTS_OPTIMIZE: Completed"
" Optimize, cleanup DELETED table"; " Optimize, cleanup DELETED table";
} }
@ -2504,7 +2492,7 @@ fts_optimize_table(
fts_optimize_free(optim); fts_optimize_free(optim);
if (fts_enable_diag_print) { if (UNIV_UNLIKELY(fts_enable_diag_print)) {
ib::info() << "FTS end optimize " << table->name; ib::info() << "FTS end optimize " << table->name;
} }
@ -2689,7 +2677,7 @@ static bool fts_optimize_del_table(const dict_table_t* table)
slot = static_cast<fts_slot_t*>(ib_vector_get(fts_slots, i)); slot = static_cast<fts_slot_t*>(ib_vector_get(fts_slots, i));
if (slot->table == table) { if (slot->table == table) {
if (fts_enable_diag_print) { if (UNIV_UNLIKELY(fts_enable_diag_print)) {
ib::info() << "FTS Optimize Removing table " ib::info() << "FTS Optimize Removing table "
<< table->name; << table->name;
} }

View file

@ -1,7 +1,7 @@
/***************************************************************************** /*****************************************************************************
Copyright (c) 2007, 2018, Oracle and/or its affiliates. All Rights Reserved. Copyright (c) 2007, 2018, Oracle and/or its affiliates. All Rights Reserved.
Copyright (c) 2017, 2019, MariaDB Corporation. Copyright (c) 2017, 2020, MariaDB Corporation.
This program is free software; you can redistribute it and/or modify it under This program is free software; you can redistribute it and/or modify it under
the terms of the GNU General Public License as published by the Free Software the terms of the GNU General Public License as published by the Free Software
@ -2447,9 +2447,8 @@ fts_query_match_document(
get_doc, match->doc_id, NULL, FTS_FETCH_DOC_BY_ID_EQUAL, get_doc, match->doc_id, NULL, FTS_FETCH_DOC_BY_ID_EQUAL,
fts_query_fetch_document, &phrase); fts_query_fetch_document, &phrase);
if (error != DB_SUCCESS) { if (UNIV_UNLIKELY(error != DB_SUCCESS)) {
ib::error() << "(" << ut_strerr(error) ib::error() << "(" << error << ") matching document.";
<< ") matching document.";
} else { } else {
*found = phrase.found; *found = phrase.found;
} }
@ -2495,8 +2494,8 @@ fts_query_is_in_proximity_range(
&get_doc, match[0]->doc_id, NULL, FTS_FETCH_DOC_BY_ID_EQUAL, &get_doc, match[0]->doc_id, NULL, FTS_FETCH_DOC_BY_ID_EQUAL,
fts_query_fetch_document, &phrase); fts_query_fetch_document, &phrase);
if (err != DB_SUCCESS) { if (UNIV_UNLIKELY(err != DB_SUCCESS)) {
ib::error() << "(" << ut_strerr(err) << ") in verification" ib::error() << "(" << err << ") in verification"
" phase of proximity search"; " phase of proximity search";
} }
@ -3501,14 +3500,6 @@ fts_query_calculate_idf(
/ (double) word_freq->doc_count); / (double) word_freq->doc_count);
} }
} }
if (fts_enable_diag_print) {
ib::info() << "'" << word_freq->word.f_str << "' -> "
<< query->total_docs << "/"
<< word_freq->doc_count << " "
<< std::setw(6) << std::setprecision(5)
<< word_freq->idf;
}
} }
} }
@ -3884,7 +3875,7 @@ fts_query_parse(
} else { } else {
query->root = state.root; query->root = state.root;
if (fts_enable_diag_print && query->root != NULL) { if (UNIV_UNLIKELY(fts_enable_diag_print) && query->root) {
fts_ast_node_print(query->root); fts_ast_node_print(query->root);
} }
} }
@ -4108,7 +4099,7 @@ fts_query(
ut_free(lc_query_str); ut_free(lc_query_str);
if (fts_enable_diag_print && (*result)) { if (UNIV_UNLIKELY(fts_enable_diag_print) && (*result)) {
ulint diff_time = ut_time_ms() - start_time_ms; ulint diff_time = ut_time_ms() - start_time_ms;
ib::info() << "FTS Search Processing time: " ib::info() << "FTS Search Processing time: "
@ -4264,7 +4255,7 @@ fts_expand_query(
query->total_size += SIZEOF_RBT_CREATE; query->total_size += SIZEOF_RBT_CREATE;
if (fts_enable_diag_print) { if (UNIV_UNLIKELY(fts_enable_diag_print)) {
fts_print_doc_id(query); fts_print_doc_id(query);
} }

View file

@ -8128,8 +8128,7 @@ ha_innobase::write_row(
if (high_level_read_only) { if (high_level_read_only) {
ib_senderrf(ha_thd(), IB_LOG_LEVEL_WARN, ER_READ_ONLY_MODE); ib_senderrf(ha_thd(), IB_LOG_LEVEL_WARN, ER_READ_ONLY_MODE);
DBUG_RETURN(HA_ERR_TABLE_READONLY); DBUG_RETURN(HA_ERR_TABLE_READONLY);
} else if (m_prebuilt->trx != trx) { } else if (UNIV_UNLIKELY(m_prebuilt->trx != trx)) {
ib::error() << "The transaction object for the table handle is" ib::error() << "The transaction object for the table handle is"
" at " << static_cast<const void*>(m_prebuilt->trx) " at " << static_cast<const void*>(m_prebuilt->trx)
<< ", but for the current thread it is at " << ", but for the current thread it is at "
@ -9989,7 +9988,7 @@ ha_innobase::ft_init_ext(
const CHARSET_INFO* char_set = key->charset(); const CHARSET_INFO* char_set = key->charset();
const char* query = key->ptr(); const char* query = key->ptr();
if (fts_enable_diag_print) { if (UNIV_UNLIKELY(fts_enable_diag_print)) {
{ {
ib::info out; ib::info out;
out << "keynr=" << keynr << ", '"; out << "keynr=" << keynr << ", '";

View file

@ -8826,7 +8826,7 @@ foreign_fail:
trx_start_for_ddl(trx, TRX_DICT_OP_TABLE); trx_start_for_ddl(trx, TRX_DICT_OP_TABLE);
dberr_t error = row_merge_drop_table(trx, ctx->old_table); dberr_t error = row_merge_drop_table(trx, ctx->old_table);
if (error != DB_SUCCESS) { if (UNIV_UNLIKELY(error != DB_SUCCESS)) {
ib::error() << "Inplace alter table " << ctx->old_table->name ib::error() << "Inplace alter table " << ctx->old_table->name
<< " dropping copy of the old table failed error " << " dropping copy of the old table failed error "
<< error << error

View file

@ -3474,7 +3474,7 @@ i_s_fts_index_table_fill_selected(
for (;;) { for (;;) {
error = fts_eval_sql(trx, graph); error = fts_eval_sql(trx, graph);
if (error == DB_SUCCESS) { if (UNIV_LIKELY(error == DB_SUCCESS)) {
fts_sql_commit(trx); fts_sql_commit(trx);
break; break;
@ -3488,7 +3488,7 @@ i_s_fts_index_table_fill_selected(
trx->error_state = DB_SUCCESS; trx->error_state = DB_SUCCESS;
} else { } else {
ib::error() << "Error occurred while reading" ib::error() << "Error occurred while reading"
" FTS index: " << ut_strerr(error); " FTS index: " << error;
break; break;
} }
} }
@ -8086,9 +8086,7 @@ i_s_dict_fill_sys_tablespaces(
break; break;
default: default:
ib::error() ib::error() << "File '" << filepath << "' " << err;
<< "File '" << filepath << "' "
<< ut_strerr(err);
break; break;
} }

View file

@ -458,7 +458,7 @@ btr_pcur_open_low(
index, level, tuple, mode, latch_mode, index, level, tuple, mode, latch_mode,
btr_cursor, 0, file, line, mtr, autoinc); btr_cursor, 0, file, line, mtr, autoinc);
if (err != DB_SUCCESS) { if (UNIV_UNLIKELY(err != DB_SUCCESS)) {
ib::warn() << " Error code: " << err ib::warn() << " Error code: " << err
<< " btr_pcur_open_low " << " btr_pcur_open_low "
<< " level: " << level << " level: " << level

View file

@ -571,6 +571,7 @@ lock_has_to_wait(
locks are record locks */ locks are record locks */
/*********************************************************************//** /*********************************************************************//**
Reports that a transaction id is insensible, i.e., in the future. */ Reports that a transaction id is insensible, i.e., in the future. */
ATTRIBUTE_COLD
void void
lock_report_trx_id_insanity( lock_report_trx_id_insanity(
/*========================*/ /*========================*/

View file

@ -1,7 +1,7 @@
/***************************************************************************** /*****************************************************************************
Copyright (c) 1994, 2016, Oracle and/or its affiliates. All Rights Reserved. Copyright (c) 1994, 2016, Oracle and/or its affiliates. All Rights Reserved.
Copyright (c) 2019, MariaDB Corporation. Copyright (c) 2019, 2020, MariaDB Corporation.
This program is free software; you can redistribute it and/or modify it under This program is free software; you can redistribute it and/or modify it under
the terms of the GNU General Public License as published by the Free Software the terms of the GNU General Public License as published by the Free Software
@ -389,48 +389,41 @@ operator<<(
It contains a std::ostringstream object. The main purpose of this class is It contains a std::ostringstream object. The main purpose of this class is
to forward operator<< to the underlying std::ostringstream object. Do not to forward operator<< to the underlying std::ostringstream object. Do not
use this class directly, instead use one of the derived classes. */ use this class directly, instead use one of the derived classes. */
class logger { class logger
public: {
template<typename T>
ATTRIBUTE_COLD
logger& operator<<(const T& rhs)
{
m_oss << rhs;
return(*this);
}
/** Write the given buffer to the internal string stream object.
@param[in] buf the buffer whose contents will be logged.
@param[in] count the length of the buffer buf.
@return the output stream into which buffer was written. */
ATTRIBUTE_COLD
std::ostream&
write(
const char* buf,
std::streamsize count)
{
return(m_oss.write(buf, count));
}
/** Write the given buffer to the internal string stream object.
@param[in] buf the buffer whose contents will be logged.
@param[in] count the length of the buffer buf.
@return the output stream into which buffer was written. */
ATTRIBUTE_COLD
std::ostream&
write(
const byte* buf,
std::streamsize count)
{
return(m_oss.write(reinterpret_cast<const char*>(buf), count));
}
std::ostringstream m_oss;
protected: protected:
/* This class must not be used directly, hence making the default /* This class must not be used directly */
constructor protected. */ ATTRIBUTE_COLD ATTRIBUTE_NOINLINE logger() {}
ATTRIBUTE_COLD public:
logger() {} template<typename T> ATTRIBUTE_COLD ATTRIBUTE_NOINLINE
logger& operator<<(const T& rhs)
{
m_oss << rhs;
return *this;
}
/** Handle a fixed character string in the same way as a pointer to
an unknown-length character string, to reduce object code bloat. */
template<size_t N> logger& operator<<(const char (&rhs)[N])
{ return *this << static_cast<const char*>(rhs); }
/** Output an error code name */
ATTRIBUTE_COLD logger& operator<<(dberr_t err);
/** Append a string.
@param buf string buffer
@param size buffer size
@return the output stream */
ATTRIBUTE_COLD __attribute__((noinline))
std::ostream &write(const char *buf, std::streamsize size)
{
return m_oss.write(buf, size);
}
std::ostream &write(const byte *buf, std::streamsize size)
{ return write(reinterpret_cast<const char*>(buf), size); }
std::ostringstream m_oss;
}; };
/** The class info is used to emit informational log messages. It is to be /** The class info is used to emit informational log messages. It is to be

View file

@ -320,6 +320,7 @@ static FILE* lock_latest_err_file;
/*********************************************************************//** /*********************************************************************//**
Reports that a transaction id is insensible, i.e., in the future. */ Reports that a transaction id is insensible, i.e., in the future. */
ATTRIBUTE_COLD
void void
lock_report_trx_id_insanity( lock_report_trx_id_insanity(
/*========================*/ /*========================*/
@ -330,7 +331,7 @@ lock_report_trx_id_insanity(
trx_id_t max_trx_id) /*!< in: trx_sys_get_max_trx_id() */ trx_id_t max_trx_id) /*!< in: trx_sys_get_max_trx_id() */
{ {
ib::error() ib::error()
<< "Transaction id " << trx_id << "Transaction id " << ib::hex(trx_id)
<< " associated with record" << rec_offsets_print(rec, offsets) << " associated with record" << rec_offsets_print(rec, offsets)
<< " in index " << index->name << " in index " << index->name
<< " of table " << index->table->name << " of table " << index->table->name
@ -359,7 +360,7 @@ lock_check_trx_id_sanity(
trx_id_t max_trx_id = trx_sys_get_max_trx_id(); trx_id_t max_trx_id = trx_sys_get_max_trx_id();
bool is_ok = trx_id < max_trx_id; bool is_ok = trx_id < max_trx_id;
if (!is_ok) { if (UNIV_UNLIKELY(!is_ok)) {
lock_report_trx_id_insanity( lock_report_trx_id_insanity(
trx_id, rec, index, offsets, max_trx_id); trx_id, rec, index, offsets, max_trx_id);
} }
@ -756,7 +757,7 @@ lock_rec_has_to_wait(
wsrep_thd_is_BF(lock2->trx->mysql_thd, TRUE)) { wsrep_thd_is_BF(lock2->trx->mysql_thd, TRUE)) {
mtr_t mtr; mtr_t mtr;
if (wsrep_debug) { if (UNIV_UNLIKELY(wsrep_debug)) {
ib::info() << ib::info() <<
"BF-BF lock conflict, locking: " << for_locking; "BF-BF lock conflict, locking: " << for_locking;
lock_rec_print(stderr, lock2, mtr); lock_rec_print(stderr, lock2, mtr);
@ -770,7 +771,7 @@ lock_rec_has_to_wait(
lock2->trx->mysql_thd) && lock2->trx->mysql_thd) &&
(type_mode & LOCK_MODE_MASK) == LOCK_X && (type_mode & LOCK_MODE_MASK) == LOCK_X &&
(lock2->type_mode & LOCK_MODE_MASK) == LOCK_X) { (lock2->type_mode & LOCK_MODE_MASK) == LOCK_X) {
if (for_locking || wsrep_debug) { if (UNIV_UNLIKELY(for_locking || wsrep_debug)) {
/* exclusive lock conflicts are not /* exclusive lock conflicts are not
accepted */ accepted */
ib::info() << ib::info() <<
@ -797,7 +798,7 @@ lock_rec_has_to_wait(
lock2->index->n_user_defined_cols lock2->index->n_user_defined_cols
operation is on uniq index operation is on uniq index
*/ */
if (wsrep_debug) { if (UNIV_UNLIKELY(wsrep_debug)) {
ib::info() << ib::info() <<
"BF conflict, modes: " "BF conflict, modes: "
<< type_mode << ":" << lock2->type_mode << type_mode << ":" << lock2->type_mode
@ -1111,7 +1112,7 @@ wsrep_kill_victim(
trx->mysql_thd, lock->trx->mysql_thd))) { trx->mysql_thd, lock->trx->mysql_thd))) {
if (lock->trx->lock.que_state == TRX_QUE_LOCK_WAIT) { if (lock->trx->lock.que_state == TRX_QUE_LOCK_WAIT) {
if (wsrep_debug) { if (UNIV_UNLIKELY(wsrep_debug)) {
ib::info() << "WSREP: BF victim waiting\n"; ib::info() << "WSREP: BF victim waiting\n";
} }
/* cannot release lock, until our lock /* cannot release lock, until our lock
@ -1344,13 +1345,14 @@ lock_number_of_tables_locked(
/*============== RECORD LOCK CREATION AND QUEUE MANAGEMENT =============*/ /*============== RECORD LOCK CREATION AND QUEUE MANAGEMENT =============*/
#ifdef WITH_WSREP #ifdef WITH_WSREP
ATTRIBUTE_COLD
static static
void void
wsrep_print_wait_locks( wsrep_print_wait_locks(
/*===================*/ /*===================*/
lock_t* c_lock) /* conflicting lock to print */ lock_t* c_lock) /* conflicting lock to print */
{ {
if (wsrep_debug && c_lock->trx->lock.wait_lock != c_lock) { if (c_lock->trx->lock.wait_lock != c_lock) {
mtr_t mtr; mtr_t mtr;
ib::info() << "WSREP: c_lock != wait lock"; ib::info() << "WSREP: c_lock != wait lock";
ib::info() << " SQL: " ib::info() << " SQL: "
@ -1502,7 +1504,7 @@ lock_rec_create_low(
c_lock->trx->lock.was_chosen_as_deadlock_victim = TRUE; c_lock->trx->lock.was_chosen_as_deadlock_victim = TRUE;
if (wsrep_debug) { if (UNIV_UNLIKELY(wsrep_debug)) {
wsrep_print_wait_locks(c_lock); wsrep_print_wait_locks(c_lock);
} }
@ -1529,7 +1531,7 @@ lock_rec_create_low(
trx_mutex_exit(c_lock->trx); trx_mutex_exit(c_lock->trx);
if (wsrep_debug) { if (UNIV_UNLIKELY(wsrep_debug)) {
ib::info() << "WSREP: c_lock canceled " ib::info() << "WSREP: c_lock canceled "
<< ib::hex(c_lock->trx->id) << ib::hex(c_lock->trx->id)
<< " SQL: " << " SQL: "
@ -1794,7 +1796,7 @@ lock_rec_enqueue_waiting(
transaction as a victim, it is possible that we transaction as a victim, it is possible that we
already have the lock now granted! */ already have the lock now granted! */
#ifdef WITH_WSREP #ifdef WITH_WSREP
if (wsrep_debug) { if (UNIV_UNLIKELY(wsrep_debug)) {
ib::info() << "WSREP: BF thread got lock granted early, ID " << ib::hex(trx->id) ib::info() << "WSREP: BF thread got lock granted early, ID " << ib::hex(trx->id)
<< " query: " << wsrep_thd_query(trx->mysql_thd); << " query: " << wsrep_thd_query(trx->mysql_thd);
} }
@ -2213,7 +2215,7 @@ lock_rec_has_to_wait_in_queue(
#ifdef WITH_WSREP #ifdef WITH_WSREP
if (wsrep_thd_is_BF(wait_lock->trx->mysql_thd, FALSE) && if (wsrep_thd_is_BF(wait_lock->trx->mysql_thd, FALSE) &&
wsrep_thd_is_BF(lock->trx->mysql_thd, TRUE)) { wsrep_thd_is_BF(lock->trx->mysql_thd, TRUE)) {
if (wsrep_debug) { if (UNIV_UNLIKELY(wsrep_debug)) {
mtr_t mtr; mtr_t mtr;
ib::info() << "WSREP: waiting BF trx: " << ib::hex(wait_lock->trx->id) ib::info() << "WSREP: waiting BF trx: " << ib::hex(wait_lock->trx->id)
<< " query: " << wsrep_thd_query(wait_lock->trx->mysql_thd); << " query: " << wsrep_thd_query(wait_lock->trx->mysql_thd);
@ -3657,7 +3659,7 @@ lock_table_create(
if (wsrep_thd_is_BF(trx->mysql_thd, FALSE)) { if (wsrep_thd_is_BF(trx->mysql_thd, FALSE)) {
ut_list_insert(table->locks, c_lock, lock, ut_list_insert(table->locks, c_lock, lock,
TableLockGetNode()); TableLockGetNode());
if (wsrep_debug) { if (UNIV_UNLIKELY(wsrep_debug)) {
ib::info() << "table lock BF conflict for " ib::info() << "table lock BF conflict for "
<< ib::hex(c_lock->trx->id) << ib::hex(c_lock->trx->id)
<< " SQL: " << " SQL: "
@ -3673,7 +3675,7 @@ lock_table_create(
if (c_lock->trx->lock.que_state == TRX_QUE_LOCK_WAIT) { if (c_lock->trx->lock.que_state == TRX_QUE_LOCK_WAIT) {
c_lock->trx->lock.was_chosen_as_deadlock_victim = TRUE; c_lock->trx->lock.was_chosen_as_deadlock_victim = TRUE;
if (wsrep_debug) { if (UNIV_UNLIKELY(wsrep_debug)) {
wsrep_print_wait_locks(c_lock); wsrep_print_wait_locks(c_lock);
} }
@ -3684,7 +3686,7 @@ lock_table_create(
c_lock->trx->lock.wait_lock); c_lock->trx->lock.wait_lock);
trx_mutex_enter(trx); trx_mutex_enter(trx);
if (wsrep_debug) { if (UNIV_UNLIKELY(wsrep_debug)) {
ib::info() << "WSREP: c_lock canceled " ib::info() << "WSREP: c_lock canceled "
<< ib::hex(c_lock->trx->id) << ib::hex(c_lock->trx->id)
<< " SQL: " << " SQL: "
@ -3957,9 +3959,9 @@ lock_table_other_has_incompatible(
#ifdef WITH_WSREP #ifdef WITH_WSREP
if (lock->trx->is_wsrep()) { if (lock->trx->is_wsrep()) {
if (wsrep_debug) { if (UNIV_UNLIKELY(wsrep_debug)) {
ib::info() << "WSREP: table lock abort for table:" ib::info() << "WSREP: table lock abort for table:"
<< table->name.m_name; << table->name;
ib::info() << " SQL: " ib::info() << " SQL: "
<< wsrep_thd_query(lock->trx->mysql_thd); << wsrep_thd_query(lock->trx->mysql_thd);
} }

View file

@ -589,7 +589,7 @@ fil_name_parse(
ut_ad(0); // the caller checked this ut_ad(0); // the caller checked this
/* fall through */ /* fall through */
case MLOG_FILE_NAME: case MLOG_FILE_NAME:
if (corrupt) { if (UNIV_UNLIKELY(corrupt)) {
ib::error() << "MLOG_FILE_NAME incorrect:" << ptr; ib::error() << "MLOG_FILE_NAME incorrect:" << ptr;
recv_sys->found_corrupt_log = true; recv_sys->found_corrupt_log = true;
break; break;
@ -599,7 +599,7 @@ fil_name_parse(
reinterpret_cast<char*>(ptr), len, space_id, false); reinterpret_cast<char*>(ptr), len, space_id, false);
break; break;
case MLOG_FILE_DELETE: case MLOG_FILE_DELETE:
if (corrupt) { if (UNIV_UNLIKELY(corrupt)) {
ib::error() << "MLOG_FILE_DELETE incorrect:" << ptr; ib::error() << "MLOG_FILE_DELETE incorrect:" << ptr;
recv_sys->found_corrupt_log = true; recv_sys->found_corrupt_log = true;
break; break;
@ -627,7 +627,7 @@ fil_name_parse(
} }
break; break;
case MLOG_FILE_RENAME2: case MLOG_FILE_RENAME2:
if (corrupt) { if (UNIV_UNLIKELY(corrupt)) {
ib::error() << "MLOG_FILE_RENAME2 incorrect:" << ptr; ib::error() << "MLOG_FILE_RENAME2 incorrect:" << ptr;
recv_sys->found_corrupt_log = true; recv_sys->found_corrupt_log = true;
} }
@ -668,7 +668,7 @@ fil_name_parse(
} }
} }
if (corrupt) { if (UNIV_UNLIKELY(corrupt)) {
ib::error() << "MLOG_FILE_RENAME2 new_name incorrect:" << ptr ib::error() << "MLOG_FILE_RENAME2 new_name incorrect:" << ptr
<< " new_name: " << new_name; << " new_name: " << new_name;
recv_sys->found_corrupt_log = true; recv_sys->found_corrupt_log = true;
@ -2697,6 +2697,7 @@ recv_calc_lsn_on_data_add(
@param[in] space tablespace ID (could be garbage) @param[in] space tablespace ID (could be garbage)
@param[in] page_no page number (could be garbage) @param[in] page_no page number (could be garbage)
@return whether processing should continue */ @return whether processing should continue */
ATTRIBUTE_COLD
static static
bool bool
recv_report_corrupt_log( recv_report_corrupt_log(
@ -2713,7 +2714,8 @@ recv_report_corrupt_log(
ib::info() << "Log record type " << type << ", page " << space << ":" ib::info() << "Log record type " << type << ", page " << space << ":"
<< page_no << ". Log parsing proceeded successfully up to " << page_no << ". Log parsing proceeded successfully up to "
<< recv_sys->recovered_lsn << ". Previous log record type " << recv_sys->recovered_lsn << ". Previous log record type "
<< recv_previous_parsed_rec_type << ", is multi " << recv_previous_parsed_rec_type
<< ", is multi "
<< recv_previous_parsed_rec_is_multi << " Recv offset " << recv_previous_parsed_rec_is_multi << " Recv offset "
<< ptr_offset << ", prev " << ptr_offset << ", prev "
<< recv_previous_parsed_rec_offset; << recv_previous_parsed_rec_offset;
@ -2853,12 +2855,12 @@ loop:
len = recv_parse_log_rec(&type, ptr, end_ptr, &space, len = recv_parse_log_rec(&type, ptr, end_ptr, &space,
&page_no, apply, &body); &page_no, apply, &body);
if (recv_sys->found_corrupt_log) { if (UNIV_UNLIKELY(recv_sys->found_corrupt_log)) {
recv_report_corrupt_log(ptr, type, space, page_no); recv_report_corrupt_log(ptr, type, space, page_no);
return(true); return(true);
} }
if (recv_sys->found_corrupt_fs) { if (UNIV_UNLIKELY(recv_sys->found_corrupt_fs)) {
return(true); return(true);
} }
@ -2982,7 +2984,7 @@ loop:
&type, ptr, end_ptr, &space, &page_no, &type, ptr, end_ptr, &space, &page_no,
false, &body); false, &body);
if (recv_sys->found_corrupt_log) { if (UNIV_UNLIKELY(recv_sys->found_corrupt_log)) {
corrupted_log: corrupted_log:
recv_report_corrupt_log( recv_report_corrupt_log(
ptr, type, space, page_no); ptr, type, space, page_no);
@ -3075,13 +3077,13 @@ corrupted_log:
&type, ptr, end_ptr, &space, &page_no, &type, ptr, end_ptr, &space, &page_no,
apply, &body); apply, &body);
if (recv_sys->found_corrupt_log if (UNIV_UNLIKELY(recv_sys->found_corrupt_log)
&& !recv_report_corrupt_log( && !recv_report_corrupt_log(
ptr, type, space, page_no)) { ptr, type, space, page_no)) {
return(true); return(true);
} }
if (recv_sys->found_corrupt_fs) { if (UNIV_UNLIKELY(recv_sys->found_corrupt_fs)) {
return(true); return(true);
} }
@ -3597,7 +3599,7 @@ recv_validate_tablespace(bool rescan, bool& missing_tablespace)
for (recv_spaces_t::iterator i = recv_spaces.begin(); for (recv_spaces_t::iterator i = recv_spaces.begin();
i != recv_spaces.end(); i++) { i != recv_spaces.end(); i++) {
if (i->second.status != file_name_t::MISSING) { if (UNIV_LIKELY(i->second.status != file_name_t::MISSING)) {
continue; continue;
} }

View file

@ -2438,7 +2438,10 @@ page_validate(
if (UNIV_UNLIKELY((ibool) !!page_is_comp(page) if (UNIV_UNLIKELY((ibool) !!page_is_comp(page)
!= dict_table_is_comp(index->table))) { != dict_table_is_comp(index->table))) {
ib::error() << "'compact format' flag mismatch"; ib::error() << "'compact format' flag mismatch";
goto func_exit2; func_exit2:
ib::error() << "Apparent corruption in space "
<< page_get_space_id(page) << " page "
<< page_get_page_no(page) << " index " << index->name;
} }
if (page_is_comp(page)) { if (page_is_comp(page)) {
if (UNIV_UNLIKELY(!page_simple_validate_new(page))) { if (UNIV_UNLIKELY(!page_simple_validate_new(page))) {
@ -2480,15 +2483,14 @@ page_validate(
n_slots = page_dir_get_n_slots(page); n_slots = page_dir_get_n_slots(page);
if (UNIV_UNLIKELY(!(page_header_get_ptr(page, PAGE_HEAP_TOP) const void* top = page_header_get_ptr(page, PAGE_HEAP_TOP);
<= page_dir_get_nth_slot(page, n_slots - 1)))) { const void* last_slot = page_dir_get_nth_slot(page, n_slots - 1);
if (UNIV_UNLIKELY(top > last_slot)) {
ib::warn() << "Record heap and dir overlap on space " ib::warn() << "Record heap and dir overlap on space "
<< page_get_space_id(page) << " page " << page_get_space_id(page) << " page "
<< page_get_page_no(page) << " index " << index->name << page_get_page_no(page) << " index " << index->name
<< ", " << page_header_get_ptr(page, PAGE_HEAP_TOP) << ", " << top << ", " << last_slot;
<< ", " << page_dir_get_nth_slot(page, n_slots - 1);
goto func_exit; goto func_exit;
} }
@ -2747,10 +2749,7 @@ func_exit:
mem_heap_free(heap); mem_heap_free(heap);
if (UNIV_UNLIKELY(ret == FALSE)) { if (UNIV_UNLIKELY(ret == FALSE)) {
func_exit2: goto func_exit2;
ib::error() << "Apparent corruption in space "
<< page_get_space_id(page) << " page "
<< page_get_page_no(page) << " index " << index->name;
} }
return(ret); return(ret);

View file

@ -864,7 +864,8 @@ loop:
num_doc_processed++; num_doc_processed++;
if (fts_enable_diag_print && num_doc_processed % 10000 == 1) { if (UNIV_UNLIKELY(fts_enable_diag_print)
&& num_doc_processed % 10000 == 1) {
ib::info() << "Number of documents processed: " ib::info() << "Number of documents processed: "
<< num_doc_processed; << num_doc_processed;
#ifdef FTS_INTERNAL_DIAG_PRINT #ifdef FTS_INTERNAL_DIAG_PRINT
@ -1009,7 +1010,7 @@ exit:
} }
} }
if (fts_enable_diag_print) { if (UNIV_UNLIKELY(fts_enable_diag_print)) {
DEBUG_FTS_SORT_PRINT(" InnoDB_FTS: start merge sort\n"); DEBUG_FTS_SORT_PRINT(" InnoDB_FTS: start merge sort\n");
} }
@ -1040,7 +1041,7 @@ exit:
} }
func_exit: func_exit:
if (fts_enable_diag_print) { if (UNIV_UNLIKELY(fts_enable_diag_print)) {
DEBUG_FTS_SORT_PRINT(" InnoDB_FTS: complete merge sort\n"); DEBUG_FTS_SORT_PRINT(" InnoDB_FTS: complete merge sort\n");
} }
@ -1215,11 +1216,9 @@ row_merge_write_fts_word(
error = row_merge_write_fts_node(ins_ctx, &word->text, fts_node); error = row_merge_write_fts_node(ins_ctx, &word->text, fts_node);
if (error != DB_SUCCESS) { if (UNIV_UNLIKELY(error != DB_SUCCESS)) {
ib::error() << "Failed to write word " ib::error() << "Failed to write word to FTS auxiliary"
<< word->text.f_str << " to FTS auxiliary" " index table, error " << error;
" index table, error (" << ut_strerr(error)
<< ")";
ret = error; ret = error;
} }
@ -1633,7 +1632,7 @@ row_fts_merge_insert(
count_diag += (int) psort_info[i].merge_file[id]->n_rec; count_diag += (int) psort_info[i].merge_file[id]->n_rec;
} }
if (fts_enable_diag_print) { if (UNIV_UNLIKELY(fts_enable_diag_print)) {
ib::info() << "InnoDB_FTS: to insert " << count_diag ib::info() << "InnoDB_FTS: to insert " << count_diag
<< " records"; << " records";
} }
@ -1801,7 +1800,7 @@ exit:
mem_heap_free(heap); mem_heap_free(heap);
if (fts_enable_diag_print) { if (UNIV_UNLIKELY(fts_enable_diag_print)) {
ib::info() << "InnoDB_FTS: inserted " << count << " records"; ib::info() << "InnoDB_FTS: inserted " << count << " records";
} }

View file

@ -1885,7 +1885,7 @@ PageConverter::update_index_page(
row_index_t* index = find_index(id); row_index_t* index = find_index(id);
if (index == 0) { if (UNIV_UNLIKELY(!index)) {
ib::error() << "Page for tablespace " << m_space ib::error() << "Page for tablespace " << m_space
<< " is index page with id " << id << " is index page with id " << id
<< " but that index is not found from" << " but that index is not found from"
@ -2132,7 +2132,7 @@ row_import_discard_changes(
ib::info() << "Discarding tablespace of table " ib::info() << "Discarding tablespace of table "
<< prebuilt->table->name << prebuilt->table->name
<< ": " << ut_strerr(err); << ": " << err;
if (trx->dict_operation_lock_mode != RW_X_LATCH) { if (trx->dict_operation_lock_mode != RW_X_LATCH) {
ut_a(trx->dict_operation_lock_mode == 0); ut_a(trx->dict_operation_lock_mode == 0);

View file

@ -4917,7 +4917,8 @@ wait_again:
goto func_exit; goto func_exit;
} }
if (indexes[i]->type & DICT_FTS && fts_enable_diag_print) { if (indexes[i]->type & DICT_FTS
&& UNIV_UNLIKELY(fts_enable_diag_print)) {
ib::info() << "Finished building full-text index " ib::info() << "Finished building full-text index "
<< indexes[i]->name; << indexes[i]->name;
} }

View file

@ -782,8 +782,7 @@ handle_new_error:
" foreign constraints and try again"; " foreign constraints and try again";
goto rollback_to_savept; goto rollback_to_savept;
default: default:
ib::fatal() << "Unknown error code " << err << ": " ib::fatal() << "Unknown error " << err;
<< ut_strerr(err);
} }
if (trx->error_state != DB_SUCCESS) { if (trx->error_state != DB_SUCCESS) {
@ -3161,10 +3160,10 @@ row_drop_ancillary_fts_tables(
dberr_t err = fts_drop_tables(trx, table); dberr_t err = fts_drop_tables(trx, table);
if (err != DB_SUCCESS) { if (UNIV_UNLIKELY(err != DB_SUCCESS)) {
ib::error() << " Unable to remove ancillary FTS" ib::error() << " Unable to remove ancillary FTS"
" tables for table " " tables for table "
<< table->name << " : " << ut_strerr(err); << table->name << " : " << err;
return(err); return(err);
} }
@ -4009,10 +4008,10 @@ loop:
table_name, trx, SQLCOM_DROP_DB); table_name, trx, SQLCOM_DROP_DB);
trx_commit_for_mysql(trx); trx_commit_for_mysql(trx);
if (err != DB_SUCCESS) { if (UNIV_UNLIKELY(err != DB_SUCCESS)) {
ib::error() << "DROP DATABASE " ib::error() << "DROP DATABASE "
<< ut_get_name(trx, name) << " failed" << ut_get_name(trx, name) << " failed"
" with error (" << ut_strerr(err) << ") for" " with error (" << err << ") for"
" table " << ut_get_name(trx, table_name); " table " << ut_get_name(trx, table_name);
ut_free(table_name); ut_free(table_name);
break; break;

View file

@ -358,15 +358,8 @@ row_undo_step(
trx->error_state = err; trx->error_state = err;
if (err != DB_SUCCESS) { if (UNIV_UNLIKELY(err != DB_SUCCESS)) {
/* SQL error detected */ ib::fatal() << "Error (" << err << ") in rollback.";
if (err == DB_OUT_OF_FILE_SPACE) {
ib::fatal() << "Out of tablespace during rollback."
" Consider increasing your tablespace.";
}
ib::fatal() << "Error (" << ut_strerr(err) << ") in rollback.";
} }
return(thr); return(thr);

View file

@ -2472,7 +2472,7 @@ row_upd_sec_index_entry(
err = DB_SUCCESS; err = DB_SUCCESS;
break; break;
case DB_LOCK_WAIT: case DB_LOCK_WAIT:
if (wsrep_debug) { if (UNIV_UNLIKELY(wsrep_debug)) {
ib::warn() << "WSREP: sec index FK lock wait" ib::warn() << "WSREP: sec index FK lock wait"
<< " index " << index->name << " index " << index->name
<< " table " << index->table->name << " table " << index->table->name
@ -2480,7 +2480,7 @@ row_upd_sec_index_entry(
} }
break; break;
case DB_DEADLOCK: case DB_DEADLOCK:
if (wsrep_debug) { if (UNIV_UNLIKELY(wsrep_debug)) {
ib::warn() << "WSREP: sec index FK check fail for deadlock" ib::warn() << "WSREP: sec index FK check fail for deadlock"
<< " index " << index->name << " index " << index->name
<< " table " << index->table->name << " table " << index->table->name
@ -2488,7 +2488,7 @@ row_upd_sec_index_entry(
} }
break; break;
default: default:
ib::error() << "WSREP: referenced FK check fail: " << ut_strerr(err) ib::error() << "WSREP: referenced FK check fail: " << err
<< " index " << index->name << " index " << index->name
<< " table " << index->table->name << " table " << index->table->name
<< " query " << wsrep_thd_query(trx->mysql_thd); << " query " << wsrep_thd_query(trx->mysql_thd);
@ -2787,14 +2787,14 @@ check_fk:
err = DB_SUCCESS; err = DB_SUCCESS;
break; break;
case DB_DEADLOCK: case DB_DEADLOCK:
if (wsrep_debug) { if (UNIV_UNLIKELY(wsrep_debug)) {
ib::warn() << "WSREP: sec index FK check fail for deadlock" ib::warn() << "WSREP: sec index FK check fail for deadlock"
<< " index " << index->name << " index " << index->name
<< " table " << index->table->name; << " table " << index->table->name;
} }
goto err_exit; goto err_exit;
default: default:
ib::error() << "WSREP: referenced FK check fail: " << ut_strerr(err) ib::error() << "WSREP: referenced FK check fail: " << err
<< " index " << index->name << " index " << index->name
<< " table " << index->table->name; << " table " << index->table->name;
goto err_exit; goto err_exit;
@ -3013,14 +3013,14 @@ row_upd_del_mark_clust_rec(
err = DB_SUCCESS; err = DB_SUCCESS;
break; break;
case DB_DEADLOCK: case DB_DEADLOCK:
if (wsrep_debug) { if (UNIV_UNLIKELY(wsrep_debug)) {
ib::warn() << "WSREP: sec index FK check fail for deadlock" ib::warn() << "WSREP: sec index FK check fail for deadlock"
<< " index " << index->name << " index " << index->name
<< " table " << index->table->name; << " table " << index->table->name;
} }
break; break;
default: default:
ib::error() << "WSREP: referenced FK check fail: " << ut_strerr(err) ib::error() << "WSREP: referenced FK check fail: " << err
<< " index " << index->name << " index " << index->name
<< " table " << index->table->name; << " table " << index->table->name;

View file

@ -119,7 +119,7 @@ row_vers_impl_x_locked_low(
if (trx == 0) { if (trx == 0) {
/* The transaction that modified or inserted clust_rec is no /* The transaction that modified or inserted clust_rec is no
longer active, or it is corrupt: no implicit lock on rec */ longer active, or it is corrupt: no implicit lock on rec */
if (corrupt) { if (UNIV_UNLIKELY(corrupt)) {
lock_report_trx_id_insanity( lock_report_trx_id_insanity(
trx_id, clust_rec, clust_index, clust_offsets, trx_id, clust_rec, clust_index, clust_offsets,
trx_sys_get_max_trx_id()); trx_sys_get_max_trx_id());

View file

@ -123,7 +123,7 @@ srv_conc_enter_innodb_with_atomics(
ulint sleep_in_us; ulint sleep_in_us;
#ifdef WITH_WSREP #ifdef WITH_WSREP
if (trx->is_wsrep() && wsrep_trx_is_aborting(trx->mysql_thd)) { if (trx->is_wsrep() && wsrep_trx_is_aborting(trx->mysql_thd)) {
if (wsrep_debug) { if (UNIV_UNLIKELY(wsrep_debug)) {
ib::info() << ib::info() <<
"srv_conc_enter due to MUST_ABORT"; "srv_conc_enter due to MUST_ABORT";
} }
@ -324,14 +324,14 @@ wsrep_srv_conc_cancel_wait(
srv_conc_enter_innodb_with_atomics(). No need to cancel here, srv_conc_enter_innodb_with_atomics(). No need to cancel here,
thr will wake up after os_sleep and let to enter innodb thr will wake up after os_sleep and let to enter innodb
*/ */
if (wsrep_debug) { if (UNIV_UNLIKELY(wsrep_debug)) {
ib::info() << "WSREP: conc slot cancel, no atomics"; ib::info() << "WSREP: conc slot cancel, no atomics";
} }
#else #else
// JAN: TODO: MySQL 5.7 // JAN: TODO: MySQL 5.7
//os_fast_mutex_lock(&srv_conc_mutex); //os_fast_mutex_lock(&srv_conc_mutex);
if (trx->wsrep_event) { if (trx->wsrep_event) {
if (wsrep_debug) { if (UNIV_UNLIKELY(wsrep_debug)) {
ib::info() << "WSREP: conc slot cancel"; ib::info() << "WSREP: conc slot cancel";
} }
os_event_set(trx->wsrep_event); os_event_set(trx->wsrep_event);

View file

@ -1329,7 +1329,7 @@ srv_init_abort_low(
#ifdef UNIV_DEBUG #ifdef UNIV_DEBUG
" at " << innobase_basename(file) << "[" << line << "]" " at " << innobase_basename(file) << "[" << line << "]"
#endif /* UNIV_DEBUG */ #endif /* UNIV_DEBUG */
" with error " << ut_strerr(err) << ". You may need" " with error " << err << ". You may need"
" to delete the ibdata1 file before trying to start" " to delete the ibdata1 file before trying to start"
" up again."; " up again.";
} else { } else {
@ -1337,7 +1337,7 @@ srv_init_abort_low(
#ifdef UNIV_DEBUG #ifdef UNIV_DEBUG
" at " << innobase_basename(file) << "[" << line << "]" " at " << innobase_basename(file) << "[" << line << "]"
#endif /* UNIV_DEBUG */ #endif /* UNIV_DEBUG */
" with error " << ut_strerr(err); " with error " << err;
} }
srv_shutdown_all_bg_threads(); srv_shutdown_all_bg_threads();

View file

@ -698,12 +698,11 @@ namespace undo {
os_file_close(handle); os_file_close(handle);
if (err != DB_SUCCESS) { if (UNIV_UNLIKELY(err != DB_SUCCESS)) {
ib::info() ib::info()
<< "Unable to read '" << "Unable to read '"
<< log_file_name << "' : " << log_file_name << "' : "
<< ut_strerr(err); << err;
os_file_delete( os_file_delete(
innodb_log_file_key, log_file_name); innodb_log_file_key, log_file_name);

View file

@ -1565,9 +1565,7 @@ trx_undo_update_rec_get_update(
<< " fields " << BUG_REPORT_MSG << " fields " << BUG_REPORT_MSG
<< ". Run also CHECK TABLE " << ". Run also CHECK TABLE "
<< index->table->name << "." << index->table->name << "."
" n_fields = " << n_fields << ", i = " << i " n_fields = " << n_fields << ", i = " << i;
<< ", ptr " << ptr;
ut_ad(0); ut_ad(0);
*upd = NULL; *upd = NULL;
return(NULL); return(NULL);

View file

@ -478,9 +478,8 @@ trx_validate_state_before_free(trx_t* trx)
ut_ad(!trx->mysql_n_tables_locked); ut_ad(!trx->mysql_n_tables_locked);
ut_ad(!trx->internal); ut_ad(!trx->internal);
if (trx->declared_to_be_inside_innodb) { if (UNIV_UNLIKELY(trx->declared_to_be_inside_innodb)) {
ib::error() << "Freeing a trx ("
ib::error() << "Freeing a trx (" << trx << ", "
<< trx_get_id_for_print(trx) << ") which is declared" << trx_get_id_for_print(trx) << ") which is declared"
" to be processing inside InnoDB"; " to be processing inside InnoDB";

View file

@ -1,7 +1,7 @@
/***************************************************************************** /*****************************************************************************
Copyright (c) 1994, 2017, Oracle and/or its affiliates. All Rights Reserved. Copyright (c) 1994, 2017, Oracle and/or its affiliates. All Rights Reserved.
Copyright (c) 2017, 2019, MariaDB Corporation. Copyright (c) 2017, 2020, MariaDB Corporation.
This program is free software; you can redistribute it and/or modify it under This program is free software; you can redistribute it and/or modify it under
the terms of the GNU General Public License as published by the Free Software the terms of the GNU General Public License as published by the Free Software
@ -614,6 +614,12 @@ ut_basename_noext(
namespace ib { namespace ib {
ATTRIBUTE_COLD logger& logger::operator<<(dberr_t err)
{
m_oss << ut_strerr(err);
return *this;
}
info::~info() info::~info()
{ {
sql_print_information("InnoDB: %s", m_oss.str().c_str()); sql_print_information("InnoDB: %s", m_oss.str().c_str());