Change log_slow_rate_type=query log_slow_rate_limit to be random
Bug #1287650 reported by
Laurynas Biveinis
This bug affects 1 person
Affects | Status | Importance | Assigned to | Milestone | |
---|---|---|---|---|---|
Percona Server moved to https://jira.percona.com/projects/PS |
Fix Released
|
Medium
|
George Ormond Lorch III | ||
5.1 |
Won't Fix
|
Undecided
|
Unassigned | ||
5.5 |
Fix Released
|
Medium
|
George Ormond Lorch III | ||
5.6 |
Fix Released
|
Medium
|
George Ormond Lorch III |
Bug Description
The current implementation of the log_slow_
This will cause some MTR testcases to test less due to reduced slow query log determinism. That's OK.
Related branches
lp:~gl-az/percona-server/bug1287650-5.5
- Alexey Kopytov (community): Approve
- Laurynas Biveinis (community): Needs Fixing
-
Diff: 255 lines (+74/-6)12 files modifiedmysql-test/r/percona_slow_query_log_always_write.result (+3/-0)
mysql-test/r/percona_slow_query_log_rate.result (+3/-0)
mysql-test/r/percona_slow_query_log_rate_limit_write.result (+3/-0)
mysql-test/suite/sys_vars/r/log_slow_rate_limit_basic.result (+27/-3)
mysql-test/suite/sys_vars/t/log_slow_rate_limit_basic.test (+11/-1)
mysql-test/t/percona_slow_query_log_always_write.test (+5/-0)
mysql-test/t/percona_slow_query_log_rate.test (+10/-0)
mysql-test/t/percona_slow_query_log_rate_limit_write.test (+5/-0)
sql/sql_class.cc (+3/-0)
sql/sql_class.h (+2/-0)
sql/sql_parse.cc (+1/-1)
sql/sys_vars.cc (+1/-1)
lp:~gl-az/percona-server/bug1287650-5.6
- Alexey Kopytov (community): Approve
- Laurynas Biveinis: Pending requested
-
Diff: 255 lines (+74/-6)12 files modifiedmysql-test/r/percona_slow_query_log_always_write.result (+3/-0)
mysql-test/r/percona_slow_query_log_rate.result (+3/-0)
mysql-test/r/percona_slow_query_log_rate_limit_write.result (+3/-0)
mysql-test/suite/sys_vars/r/log_slow_rate_limit_basic.result (+27/-3)
mysql-test/suite/sys_vars/t/log_slow_rate_limit_basic.test (+11/-1)
mysql-test/t/percona_slow_query_log_always_write.test (+5/-0)
mysql-test/t/percona_slow_query_log_rate.test (+10/-0)
mysql-test/t/percona_slow_query_log_rate_limit_write.test (+5/-0)
sql/sql_class.cc (+3/-0)
sql/sql_class.h (+2/-0)
sql/sql_parse.cc (+1/-1)
sql/sys_vars.cc (+1/-1)
tags: | added: slow-extended |
To post a comment you must log in.
So Laurynas, do you think changing the "thd->thread_id % thd->variables. log_slow_ rate_limit" test to something like "thd->thread_id % thd->variables. log_slow_ rate_limit != rand() % thd->variables. log_slow_ rate_limit" would be acceptable?
There are other ways but this would yield a non deterministic actual rate. Over the long haul the real output rate would certainly approximate the desired rate but it would not be a guarantee that "one in every log_slow_rate_limit queries will be logged", i.e. if log_slow_rate_limit is set to 100, there is no absolute guarantee that in 100 queries, exactly one will be logged.
Another way would be to keep some extra value and do something like:
static somevalue = rand() % log_slow_ rate_limit;
if( thd->thread_id % thd->variables. log_slow_ rate_limit == somevalue)