mirror of
https://github.com/MariaDB/server.git
synced 2025-04-02 05:15:33 +02:00
MyRocks: MDEV-15911: Reduce debug logging on default levels in error log
MyRocks internally will print non-critical messages to sql_print_verbose_info() which will do what InnoDB does in similar cases: check if (global_system_variables.log_warnings > 2).
This commit is contained in:
parent
efae12680e
commit
0c02c91bc1
5 changed files with 40 additions and 19 deletions
12
sql/log.cc
12
sql/log.cc
|
@ -8747,16 +8747,20 @@ void sql_print_information(const char *format, ...)
|
|||
va_list args;
|
||||
DBUG_ENTER("sql_print_information");
|
||||
|
||||
if (disable_log_notes)
|
||||
DBUG_VOID_RETURN; // Skip notes during start/shutdown
|
||||
|
||||
va_start(args, format);
|
||||
error_log_print(INFORMATION_LEVEL, format, args);
|
||||
sql_print_information_v(format, args);
|
||||
va_end(args);
|
||||
|
||||
DBUG_VOID_RETURN;
|
||||
}
|
||||
|
||||
void sql_print_information_v(const char *format, va_list ap)
|
||||
{
|
||||
if (disable_log_notes)
|
||||
return; // Skip notes during start/shutdown
|
||||
|
||||
error_log_print(INFORMATION_LEVEL, format, ap);
|
||||
}
|
||||
|
||||
void
|
||||
TC_LOG::run_prepare_ordered(THD *thd, bool all)
|
||||
|
|
|
@ -1075,6 +1075,7 @@ int vprint_msg_to_log(enum loglevel level, const char *format, va_list args);
|
|||
void sql_print_error(const char *format, ...);
|
||||
void sql_print_warning(const char *format, ...);
|
||||
void sql_print_information(const char *format, ...);
|
||||
void sql_print_information_v(const char *format, va_list ap);
|
||||
typedef void (*sql_print_message_func)(const char *format, ...);
|
||||
extern sql_print_message_func sql_print_message_handlers[];
|
||||
|
||||
|
|
|
@ -220,8 +220,8 @@ static int rocksdb_compact_column_family(THD *const thd,
|
|||
if (const char *const cf = value->val_str(value, buff, &len)) {
|
||||
auto cfh = cf_manager.get_cf(cf);
|
||||
if (cfh != nullptr && rdb != nullptr) {
|
||||
sql_print_information("RocksDB: Manual compaction of column family: %s\n",
|
||||
cf);
|
||||
sql_print_verbose_info("RocksDB: Manual compaction of column family: %s\n",
|
||||
cf);
|
||||
rdb->CompactRange(getCompactRangeOptions(), cfh, nullptr, nullptr);
|
||||
}
|
||||
}
|
||||
|
@ -7776,8 +7776,8 @@ int ha_rocksdb::check(THD *const thd, HA_CHECK_OPT *const check_opt) {
|
|||
|
||||
/* For each secondary index, check that we can get a PK value from it */
|
||||
// NO_LINT_DEBUG
|
||||
sql_print_information("CHECKTABLE %s: Checking table %s", table_name,
|
||||
table_name);
|
||||
sql_print_verbose_info("CHECKTABLE %s: Checking table %s", table_name,
|
||||
table_name);
|
||||
ha_rows UNINIT_VAR(row_checksums_at_start); // set/used iff first_index==true
|
||||
ha_rows row_checksums = ha_rows(-1);
|
||||
bool first_index = true;
|
||||
|
@ -7792,8 +7792,8 @@ int ha_rocksdb::check(THD *const thd, HA_CHECK_OPT *const check_opt) {
|
|||
row_checksums_at_start = m_row_checksums_checked;
|
||||
int res;
|
||||
// NO_LINT_DEBUG
|
||||
sql_print_information("CHECKTABLE %s: Checking index %s", table_name,
|
||||
table->key_info[keyno].name);
|
||||
sql_print_verbose_info("CHECKTABLE %s: Checking index %s", table_name,
|
||||
table->key_info[keyno].name);
|
||||
while (1) {
|
||||
if (!rows)
|
||||
res = index_first(table->record[0]);
|
||||
|
@ -7881,9 +7881,9 @@ int ha_rocksdb::check(THD *const thd, HA_CHECK_OPT *const check_opt) {
|
|||
}
|
||||
}
|
||||
// NO_LINT_DEBUG
|
||||
sql_print_information("CHECKTABLE %s: ... %lld index entries checked "
|
||||
"(%lld had checksums)",
|
||||
table_name, rows, checksums);
|
||||
sql_print_verbose_info("CHECKTABLE %s: ... %lld index entries checked "
|
||||
"(%lld had checksums)",
|
||||
table_name, rows, checksums);
|
||||
|
||||
if (first_index) {
|
||||
row_checksums = m_row_checksums_checked - row_checksums_at_start;
|
||||
|
@ -7894,8 +7894,8 @@ int ha_rocksdb::check(THD *const thd, HA_CHECK_OPT *const check_opt) {
|
|||
}
|
||||
if (row_checksums != ha_rows(-1)) {
|
||||
// NO_LINT_DEBUG
|
||||
sql_print_information("CHECKTABLE %s: %lld table records had checksums",
|
||||
table_name, row_checksums);
|
||||
sql_print_verbose_info("CHECKTABLE %s: %lld table records had checksums",
|
||||
table_name, row_checksums);
|
||||
}
|
||||
extra(HA_EXTRA_NO_KEYREAD);
|
||||
|
||||
|
@ -12655,8 +12655,20 @@ double ha_rocksdb::read_time(uint index, uint ranges, ha_rows rows) {
|
|||
DBUG_RETURN((rows / 20.0) + 1);
|
||||
}
|
||||
|
||||
void sql_print_verbose_info(const char *format, ...)
|
||||
{
|
||||
va_list args;
|
||||
|
||||
if (global_system_variables.log_warnings > 2) {
|
||||
va_start(args, format);
|
||||
sql_print_information_v(format, args);
|
||||
va_end(args);
|
||||
}
|
||||
}
|
||||
|
||||
} // namespace myrocks
|
||||
|
||||
|
||||
/**
|
||||
Construct and emit duplicate key error message using information
|
||||
from table's record buffer.
|
||||
|
|
|
@ -1415,4 +1415,8 @@ private:
|
|||
const int MYROCKS_MARIADB_PLUGIN_MATURITY_LEVEL= MariaDB_PLUGIN_MATURITY_GAMMA;
|
||||
|
||||
extern bool prevent_myrocks_loading;
|
||||
|
||||
void sql_print_verbose_info(const char *format, ...);
|
||||
|
||||
} // namespace myrocks
|
||||
|
||||
|
|
|
@ -4906,8 +4906,8 @@ void Rdb_dict_manager::add_create_index(
|
|||
rocksdb::WriteBatch *const batch) const {
|
||||
for (const auto &gl_index_id : gl_index_ids) {
|
||||
// NO_LINT_DEBUG
|
||||
sql_print_information("RocksDB: Begin index creation (%u,%u)",
|
||||
gl_index_id.cf_id, gl_index_id.index_id);
|
||||
sql_print_verbose_info("RocksDB: Begin index creation (%u,%u)",
|
||||
gl_index_id.cf_id, gl_index_id.index_id);
|
||||
start_create_index(batch, gl_index_id);
|
||||
}
|
||||
}
|
||||
|
@ -4986,8 +4986,8 @@ void Rdb_dict_manager::rollback_ongoing_index_creation() const {
|
|||
|
||||
for (const auto &gl_index_id : gl_index_ids) {
|
||||
// NO_LINT_DEBUG
|
||||
sql_print_information("RocksDB: Removing incomplete create index (%u,%u)",
|
||||
gl_index_id.cf_id, gl_index_id.index_id);
|
||||
sql_print_verbose_info("RocksDB: Removing incomplete create index (%u,%u)",
|
||||
gl_index_id.cf_id, gl_index_id.index_id);
|
||||
|
||||
start_drop_index(batch, gl_index_id);
|
||||
}
|
||||
|
|
Loading…
Add table
Reference in a new issue