Merge lp:~gl-az/percona-server/BT-27444-bug1083700 into lp:percona-server/5.5

Proposed by George Ormond Lorch III
Status: Merged
Approved by: Alexey Kopytov
Approved revision: no longer in the source branch.
Merged at revision: 367
Proposed branch: lp:~gl-az/percona-server/BT-27444-bug1083700
Merge into: lp:percona-server/5.5
Diff against target: 16 lines (+5/-1)
1 file modified
Percona-Server/storage/innobase/fsp/fsp0fsp.c (+5/-1)
To merge this branch: bzr merge lp:~gl-az/percona-server/BT-27444-bug1083700
Reviewer Review Type Date Requested Status
Laurynas Biveinis (community) Needs Fixing
Alexey Kopytov (community) Approve
Review via email: mp+136473@code.launchpad.net

Description of the change

Fix for lp 1083700 and 1079596:
An unsigned math error in fsp_reserve_free_extents causes function to believe that there are already many free extents available when FSP_SIZE < FSP_FREE_LIMIT, causing function to do nothing and possibly allow out of space errors to go undetected until attempted use of non-existent space occurs.

27444

Jenkins run for same code but different branch name before bug was split off:
http://jenkins.percona.com/view/PS%205.5/job/percona-server-5.5-param/585/

To post a comment you must log in.
Revision history for this message
Alexey Kopytov (akopytov) :
review: Approve
Revision history for this message
Laurynas Biveinis (laurynas-biveinis) wrote :

This fix does not take into account the existing special small tablespace (size < FSP_EXTENT_SIZE / 2, i.e. 32 pages) handling in fsp_reserve_free_extents(). Such tablespaces have free_limit > size by design. Thus a combination of this and of http://bugs.mysql.com/bug.php?id=68970 aka bug 1169494 (where tablespaces between 32 and 64 pages are treated as big tablespaces even though for them free_limit > size holds, resulting in unexpected or extremely counter-intuitive if intended unsigned math) means that small tablespaces balloon (a testcase innodb_wl6347_comp_indx_stat from 5.6):

@@ -987,7 +987,7 @@
 AND table_name='tab5' AND database_name='test'
 AND index_name like 'idx%' ;
 compress_stat 1
-The size of the tab5.ibd file: 159744
+The size of the tab5.ibd file: 2097152
 # fetch the compressed page and check the stats
 ===============
 Fetch Records
@@ -1013,7 +1013,7 @@
 AND table_name='tab5' AND database_name='test'
 AND index_name like 'idx%' ;
 compress_stat 1
-The size of the tab5.ibd file: 159744
+The size of the tab5.ibd file: 2097152
 # fetch the compressed same page once again and check the stats
 # the stat figures should be same as above query
 ===============
@@ -1040,7 +1040,7 @@
 AND table_name='tab5' AND database_name='test'
 AND index_name like 'idx%' ;
 compress_stat 1
-The size of the tab5.ibd file: 159744
+The size of the tab5.ibd file: 2097152
 #cleanup
 DROP TABLE IF EXISTS tab5;
 #reset the stat table before starting next testcase

mysqltest: Result content mismatch

Thus, we will have to fix bug 1169494 now.

review: Needs Fixing

Preview Diff

[H/L] Next/Prev Comment, [J/K] Next/Prev File, [N/P] Next/Prev Hunk
1=== modified file 'Percona-Server/storage/innobase/fsp/fsp0fsp.c'
2--- Percona-Server/storage/innobase/fsp/fsp0fsp.c 2012-06-01 12:15:25 +0000
3+++ Percona-Server/storage/innobase/fsp/fsp0fsp.c 2012-11-27 17:50:35 +0000
4@@ -3034,7 +3034,11 @@
5 some of them will contain extent descriptor pages, and therefore
6 will not be free extents */
7
8- n_free_up = (size - free_limit) / FSP_EXTENT_SIZE;
9+ if (size <= free_limit) {
10+ n_free_up = 0;
11+ } else {
12+ n_free_up = (size - free_limit) / FSP_EXTENT_SIZE;
13+ }
14
15 if (n_free_up > 0) {
16 n_free_up--;

Subscribers

People subscribed via source and target branches