| List: | Commits | « Previous MessageNext Message » | |
| From: | Davi Arnaut | Date: | November 23 2009 9:51am |
| Subject: | Re: bzr commit into mysql-5.1-bugteam branch (Dao-Gang.Qu:3192) Bug#42851 | ||
| View as plain text | |||
Hi Dao-Gang, A few comments below. On 11/23/09 6:42 AM, Dao-Gang.Qu@stripped wrote: > #At file:///home/daogangqu/mysql/bzrwork/bug42851/mysql-5.1-bugteam/ based on > revid:davi.arnaut@stripped > > 3192 Dao-Gang.Qu@stripped 2009-11-23 > Bug #42851 Spurious "Statement is not safe to log in statement format." > warnings > > Warnings in error log make error log grow too large. > > The problem can be resolved by limiting the rate of messages that are > written to the log. A volume of messages that is less than or equal to > the specified rate is written to the log, whereas the volume of messages > that exceeds the rate is discarded. > > For example, > > log-warnings-ratelimit-interval = 10 > log-warnings-ratelimit-burst = 5 > > This allows 5 log messages per 10 seconds. The sixth (and posterior) > attempts to write a log message within a 10 seconds interval are > discarded. [..] > + > +void Log_to_file_event_handler::rate_limit_exceeded() > +{ > + sql_print_error("log-warnings-ratelimit-burst parameter's value (N) \ > +exceeded; discarding the rest of error messages"); Please, break the string in a way that preserves indentation: sql_print_errror("log-warnings-ratelimit-burst parameter's value (N) " "exceeded; discarding the rest of error messages"); and the message looks like broken english. What is N? Please, consult the documentation team if you think the original messages weren't clear enough -- which i think were good enough, if a user does not understand it, he should look it up in the docs where he/she will find a extended explanation. > +} > + > +void Log_to_file_event_handler::rate_limit_reset(unsigned int suppressed) > +{ > + sql_print_error("Rate limit lifted, %u warning messages were suppressed.", > + suppressed); > } > > void Log_to_file_event_handler::init_pthread_objects() > > === modified file 'sql/log.h' > --- a/sql/log.h 2009-06-18 13:52:46 +0000 > +++ b/sql/log.h 2009-11-23 08:42:40 +0000 > @@ -16,6 +16,9 @@ > #ifndef LOG_H > #define LOG_H > > +extern ulong log_warnings_ratelimit_interval; > +extern ulong log_warnings_ratelimit_burst; > + > class Relay_log_info; > > class Format_description_log_event; > @@ -459,15 +462,88 @@ public: > }; > > > +/** > + Rate limiter. > +*/ > + > +class Rate_limit > +{ > + public: > + Rate_limit() : m_count(0), m_suppressed(0), m_begin(0), > + interval(0), burst(0) > + {} Please add a virtual destructor.
