FLUSH INDEX_STATISTICS / FLUSH CHANGED_PAGE_BITMAPS and FLUSH USER_STATISTICS / RESET CHANGE_PAGE_BITMAPS pairs of commands are joined

Bug #1472251 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
Fix Released
High
Laurynas Biveinis
5.1
Invalid
Undecided
Unassigned
5.5
Fix Released
High
Laurynas Biveinis
5.6
Fix Released
High
Laurynas Biveinis

Bug Description

From mysql_com.h in 5.6
=====

#define REFRESH_INDEX_STATS 0x400000L /* Refresh index stats my_hash
                                             table */
#define REFRESH_USER_STATS 0x800000L /* Refresh user stats my_hash
                                             table */

#define REFRESH_FLUSH_PAGE_BITMAPS 0x400000L
#define REFRESH_RESET_PAGE_BITMAPS 0x800000L

This can cause one operation to affect or cause another and vice-versa.

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

Also in 5.5:

#define REFRESH_TABLE_STATS 0x200000L /* Refresh table stats my_hash table */
#define REFRESH_INDEX_STATS 0x400000L /* Refresh index stats my_hash table */
#define REFRESH_USER_STATS 0x800000L /* Refresh user stats my_hash table */
#define REFRESH_CLIENT_STATS 0x1000000L /* Refresh client stats my_hash table */
#define REFRESH_THREAD_STATS 0x2000000L /* Refresh thread stats my_hash table */
#define REFRESH_FLUSH_PAGE_BITMAPS 0x400000L
#define REFRESH_RESET_PAGE_BITMAPS 0x800000L

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

5.1 looks good:

#define REFRESH_TABLE_STATS 256 /* Refresh table stats hash table */
#define REFRESH_INDEX_STATS 512 /* Refresh index stats hash table */
#define REFRESH_USER_STATS 1024 /* Refresh user stats hash table */
#define REFRESH_SLOW_QUERY_LOG 2048 /* Flush slow query log and rotate*/
#define REFRESH_CLIENT_STATS 4096 /* Refresh client stats hash table */
#define REFRESH_THREAD_STATS 8192 /* Refresh thread stats hash table */

/* The following can't be set with mysql_refresh() */
#define REFRESH_READ_LOCK 16384 /* Lock tables for read */
#define REFRESH_FAST 32768 /* Intern flag */

/* RESET (remove all queries) from query cache */
#define REFRESH_QUERY_CACHE 65536
#define REFRESH_QUERY_CACHE_FREE 0x20000L /* pack query cache */
#define REFRESH_DES_KEY_FILE 0x40000L
#define REFRESH_USER_RESOURCES 0x80000L
#define REFRESH_QUERY_RESPONSE_TIME 0x100000L /* response time distibution */
#define REFRESH_FLUSH_PAGE_BITMAPS 0x200000L
#define REFRESH_RESET_PAGE_BITMAPS 0x400000L

description: updated
tags: added: bitmap
Revision history for this message
Laurynas Biveinis (laurynas-biveinis) wrote :

Effectively this makes the pairs of FLUSH INDEX_STATISTICS / FLUSH CHANGED_PAGE_BITMAPS and FLUSH USER_STATISTICS / RESET CHANGE_PAGE_BITMAPS joined, issuing either command has the effect of both. The first is relatively benign but has a bug that FLUSH INDEX_STATISTICS starts requiring SUPER instead of RELOAD privilege. The second pair destroys bitmaps if one issues FLUSH USER_STATISTICS, which is more serious.

summary: - Conflicting identifiers assigned same value in the header file
+ FLUSH INDEX_STATISTICS / FLUSH CHANGED_PAGE_BITMAPS and FLUSH
+ USER_STATISTICS / RESET CHANGE_PAGE_BITMAPS pairs of commands are joined
tags: added: low-hanging-fruit
Revision history for this message
Laurynas Biveinis (laurynas-biveinis) wrote :
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-913

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.