Highly verbose update statistics messages with UNIV_DEBUG on

Bug #1043608 reported by Raghavendra D Prabhu
6
This bug affects 1 person
Affects Status Importance Assigned to Milestone
Percona Server moved to https://jira.percona.com/projects/PS
Status tracked in 5.7
5.1
Won't Fix
Low
Unassigned
5.5
Triaged
Low
Unassigned
5.6
Invalid
Undecided
Unassigned
5.7
Invalid
Undecided
Unassigned

Bug Description

With UNIV_DEBUG on in percona server, stderr is spammed with hundreds of messages like

"InnoDB: DEBUG: update_statistics for <some-table>"

It is easy to lose other important messages with this.

It is better to use DBUG_PRINT for this than the current fprintf to stderr which it currently does.

==============================
=== modified file 'Percona-Server/storage/innobase/dict/dict0dict.c'
--- Percona-Server/storage/innobase/dict/dict0dict.c 2012-08-07 06:10:00 +0000
+++ Percona-Server/storage/innobase/dict/dict0dict.c 2012-08-30 03:00:29 +0000
@@ -4680,6 +4680,7 @@
                                        do nothing */
        ibool sync) /*!< in: TRUE if must update SYS_STATS */
 {
+ DBUG_ENTER("dict_update_statistics");
        dict_index_t* index;
        ulint sum_of_index_sizes = 0;

@@ -4692,7 +4693,7 @@
                        "InnoDB: " REFMAN "innodb-troubleshooting.html\n",
                        table->name);

- return;
+ DBUG_VOID_RETURN;
        }

        if (srv_use_sys_stats_table && !((table->flags >> DICT_TF2_SHIFT) & DICT_TF2_TEMPORARY) && !sync) {
@@ -4702,8 +4703,8 @@
                if (dict_reload_statistics(table, &sum_of_index_sizes)) {
                        /* success */
 #ifdef UNIV_DEBUG
- fprintf(stderr, "InnoDB: DEBUG: reload_statistics succeeded for %s.\n",
- table->name);
+ DBUG_PRINT("info", ("InnoDB: DEBUG: reload_statistics succeeded for %s.\n",
+ table->name));
 #endif
                        goto end;
                }
@@ -4711,8 +4712,8 @@
                dict_table_stats_unlock(table, RW_X_LATCH);
        }
 #ifdef UNIV_DEBUG
- fprintf(stderr, "InnoDB: DEBUG: update_statistics for %s.\n",
- table->name);
+ DBUG_PRINT("info", ("InnoDB: DEBUG: update_statistics for %s.\n",
+ table->name));
 #endif
        sum_of_index_sizes = 0;

@@ -4724,14 +4725,14 @@
        if (index == NULL) {
                /* Table definition is corrupt */

- return;
+ DBUG_VOID_RETURN;
        }

        dict_table_stats_lock(table, RW_X_LATCH);

        if (only_calc_if_missing_stats && table->stat_initialized) {
                dict_table_stats_unlock(table, RW_X_LATCH);
- return;
+ DBUG_VOID_RETURN;
        }

        do {
@@ -4745,7 +4746,7 @@
                        if (table->is_corrupt) {
                                ut_a(srv_pass_corrupt_table);
                                dict_table_stats_unlock(table, RW_X_LATCH);
- return;
+ DBUG_VOID_RETURN;
                        }

                        mtr_start(&mtr);
===================

tags: added: contribution
Revision history for this message
Alexey Kopytov (akopytov) wrote :

Yes, the update_statistic messages are annoying. However, DBUG_* macros are not available in InnoDB. We can just remove the message, it doesn't make any sense.

tags: removed: contribution
Revision history for this message
Raghavendra D Prabhu (raghavendra-prabhu) wrote :

Hmm, I think my_dbug.h must be included somewhere in Innodb code, because it built and ran without glitch. Btw, one more DBUG_VOID_RETURN is missing from there. http://sprunge.us/YDfF?c is patch with the correction.

tags: added: innodb upstream
Revision history for this message
Shahriyar Rzayev (rzayev-sehriyar) wrote :

Percona now uses JIRA for bug reports so this bug report is migrated to: https://jira.percona.com/browse/PS-2798

To post a comment you must log in.
This report contains Public information  
Everyone can see this information.

Other bug subscribers

Remote bug watches

Bug watches keep track of this bug in other bug trackers.