[MDEV-20752] innodb_zip.cmp_per_index is broken with -DUNIV_ZIP_COPY -DUNIV_ZIP_DEBUG defines Created: 2019-10-04  Updated: 2022-02-21  Resolved: 2022-02-21

Status: Closed
Project: MariaDB Server
Component/s: Storage Engine - InnoDB
Affects Version/s: 10.2, 10.3, 10.4
Fix Version/s: N/A

Type: Bug Priority: Major
Reporter: Eugene Kosov (Inactive) Assignee: Marko Mäkelä
Resolution: Won't Fix Votes: 0
Labels: None


 Description   

innodb_zip.cmp_per_index 'innodb'        [ fail ]
        Test ended at 2019-10-04 16:46:28
 
CURRENT_TEST: innodb_zip.cmp_per_index
--- /home/kevg/work/m/bb-10.2-kevgs/mysql-test/suite/innodb_zip/r/cmp_per_index.result	2019-10-03 17:34:38.626389892 +0300
+++ /home/kevg/work/m/bb-10.2-kevgs/mysql-test/suite/innodb_zip/r/cmp_per_index.reject	2019-10-04 16:46:28.612642509 +0300
@@ -61,14 +61,14 @@
 database_name	test
 table_name	t
 index_name	b
-compress_ops	43
-compress_ops_ok	43
+compress_ops	42
+compress_ops_ok	42
 uncompress_ops	0
 database_name	test
 table_name	t
 index_name	PRIMARY
-compress_ops	65
-compress_ops_ok	65
+compress_ops	45
+compress_ops_ok	45
 uncompress_ops	0
 SHOW CREATE TABLE t;
 Table	t
@@ -97,6 +97,6 @@
 index_name	PRIMARY
 compress_ops	0
 compress_ops_ok	0
-uncompress_ops	4
+uncompress_ops	2
 DROP TABLE t;
 SET GLOBAL innodb_cmp_per_index_enabled=default;

In a more recent branches also innodb.index_merge_threshold is broken in a similar manner:

--- /home/kevg/work/m/bb-10.3-MDEV-19783-check-table/mysql-test/suite/innodb/r/index_merge_threshold.result    2019-10-03 13:32:31.117762090 +0300
+++ /home/kevg/work/m/bb-10.3-MDEV-19783-check-table/mysql-test/suite/innodb/r/index_merge_threshold.reject    2019-10-04 13:03:11.654942019 +0300
@@ -1242,9 +1242,10 @@
 and PAGE_TYPE = "INDEX" order by PAGE_NUMBER, NUMBER_RECORDS;
 PAGE_NUMBER    NUMBER_RECORDS
 3    42
-4    2
+4    3
 27    21
-28    21
+28    10
+30    11
 begin;
 delete from tab1 where a = 33;
 delete from tab1 where a = 34;
@@ -1272,8 +1273,8 @@
 SELECT name,count_reset FROM information_schema.innodb_metrics
 WHERE name like 'index_page_merge_%';
 name    count_reset
-index_page_merge_attempts    0
-index_page_merge_successful    0
+index_page_merge_attempts    1
+index_page_merge_successful    1
 select PAGE_NUMBER, NUMBER_RECORDS
 from INFORMATION_SCHEMA.INNODB_SYS_TABLESPACES s1,
 INFORMATION_SCHEMA.INNODB_BUFFER_PAGE s2
@@ -1283,30 +1284,31 @@
 3    22
 4    2
 27    11
-28    11
+28    9
+30    11
 delete from tab1 where a = 32;
 InnoDB        0 transactions not purged
 # check page merge happens (MERGE_THRESHOLD=50 causes merge here)
 SELECT name,count_reset FROM information_schema.innodb_metrics
 WHERE name like 'index_page_merge_%';
 name    count_reset
-index_page_merge_attempts    0
-index_page_merge_successful    0
+index_page_merge_attempts    1
+index_page_merge_successful    1
 delete from tab1 where a = 31;
 InnoDB        0 transactions not purged
 # check page merge happens (MERGE_THRESHOLD=45 causes merge here)
 SELECT name,count_reset FROM information_schema.innodb_metrics
 WHERE name like 'index_page_merge_%';
 name    count_reset
-index_page_merge_attempts    1
-index_page_merge_successful    1
+index_page_merge_attempts    2
+index_page_merge_successful    2
 delete from tab1 where a = 30;
 InnoDB        0 transactions not purged
 # check page merge happens (MERGE_THRESHOLD=40 causes merge here)
 SELECT name,count_reset FROM information_schema.innodb_metrics
 WHERE name like 'index_page_merge_%';
 name    count_reset
-index_page_merge_attempts    2
-index_page_merge_successful    2
+index_page_merge_attempts    3
+index_page_merge_successful    3
 DROP TABLE tab1;
 SET GLOBAL innodb_purge_rseg_truncate_frequency = @saved_frequency;



 Comments   
Comment by Marko Mäkelä [ 2022-02-21 ]

The purpose of #define UNIV_ZIP_COPY is to trigger page recompression more frequently. The purpose of #define UNIV_ZIP_DEBUG is to invoke page_zip_validate(), to check the consistency of the uncompressed and compressed copy of a ROW_FORMAT=COMPRESSED page. These macros were useful back in 2005 to 2008 when I developed the format, but probably not so much anymore. The compression statistics were added later.

Generated at Thu Feb 08 09:01:54 UTC 2024 using Jira 8.20.16#820016-sha1:9d11dbea5f4be3d4cc21f03a88dd11d8c8687422.