elenst, would it be possible to narrow down the test to the relevant part (see below) and repeat it to establish how often it can fail?
The test result differs immediately after the test creates, populates and analyzes the first table named test.t.
Because the table creation and population only involves INSERT statements and no UPDATE or DELETE, the result should actually be deterministic, with the purge playing no role whatsoever. There are no secondary indexes, so change buffering should not kick in either.
This is the corresponding section of the test input:
CREATE TABLE t(col BLOB) ENGINE=InnoDB ROW_FORMAT=DYNAMIC;
|
SHOW WARNINGS;
|
INSERT INTO t VALUES (REPEAT('a',16384));
|
INSERT INTO t VALUES (REPEAT('a',32768));
|
INSERT INTO t VALUES (REPEAT('a',65535));
|
SELECT LENGTH(col) FROM t;
|
FLUSH TABLE t;
|
ANALYZE TABLE t;
|
# retrieve the number of leaf pages
|
SELECT stat_value FROM mysql.innodb_index_stats where database_name = 'test' and table_name= 't' and stat_name='n_leaf_pages';
|
SELECT clustered_index_size from mysql.innodb_table_stats where database_name = 'test' and table_name= 't';
|
DROP TABLE t;
|
Perhaps this intermittent failure to compute correct statistics could explain MDEV-7142?
Note: while the other statistics can be estimates, the number of pages should always be accurate, from btr_get_size().
In this table, we expet all 3 records to be stored in the root page, and 1+1+2 BLOB pages being referred to by the records. Somehow there appear to be 2 fewer BLOB pages than expected.
elenst, would it be possible to narrow down the test to the relevant part (see below) and repeat it to establish how often it can fail?
The test result differs immediately after the test creates, populates and analyzes the first table named test.t.
Because the table creation and population only involves INSERT statements and no UPDATE or DELETE, the result should actually be deterministic, with the purge playing no role whatsoever. There are no secondary indexes, so change buffering should not kick in either.
This is the corresponding section of the test input:
SHOW WARNINGS;
Perhaps this intermittent failure to compute correct statistics could explain
MDEV-7142?Note: while the other statistics can be estimates, the number of pages should always be accurate, from btr_get_size().
In this table, we expet all 3 records to be stored in the root page, and 1+1+2 BLOB pages being referred to by the records. Somehow there appear to be 2 fewer BLOB pages than expected.