[MDEV-20532] Tests fail massively in buildbot on rhel8-ppc64le with floating point differences Created: 2019-09-08  Updated: 2023-04-27

Status: Open
Project: MariaDB Server
Component/s: Data types, Tests
Affects Version/s: 10.3, 10.4, 10.5
Fix Version/s: 10.4, 10.5

Type: Bug Priority: Major
Reporter: Elena Stepanova Assignee: Oleksandr Byelkin
Resolution: Unresolved Votes: 0
Labels: None

Issue Links:
Relates
relates to MDEV-20530 binlog.binlog_mysqlbinlog_row_innodb ... Stalled
relates to MDEV-20531 innodb.temporary_table_optimization f... Closed

 Description   

http://buildbot.askmonty.org/buildbot/builders/kvm-rpm-rhel8-ppc64le/builds/120/steps/mtr/logs/stdio

10.3 f80e02e043103ab4e6ca12d9efffec6eb9aa3b74

main.ps                                  w4 [ fail ]
        Test ended at 2019-09-07 12:37:15
 
CURRENT_TEST: main.ps
/usr/bin/mysqltest: Error on delete of '/dev/shm/var/4/tmp/f1.txt' (Errcode: 2 "No such file or directory")
--- /usr/share/mysql-test/main/ps.result	2019-09-07 09:08:23.000000000 +0000
+++ /dev/shm/var/4/log/ps.reject	2019-09-07 12:37:15.313985734 +0000
@@ -3509,7 +3509,7 @@
 ) ENGINE=MyISAM DEFAULT CHARSET=latin1
 SELECT @a, @a - 123.4567 < 0.00001;
 @a	@a - 123.4567 < 0.00001
-123.45670318603516	1
+123.45669555664062	1
 DROP TEMPORARY TABLE tmp1;
 DROP PROCEDURE p1;
 
 
mysqltest: Result content mismatch

main.select_pkeycache                    w2 [ fail ]
        Test ended at 2019-09-07 12:45:11
 
CURRENT_TEST: main.select_pkeycache
--- /usr/share/mysql-test/main/select_pkeycache.result	2019-09-07 09:08:23.000000000 +0000
+++ /dev/shm/var/2/log/select_pkeycache.reject	2019-09-07 12:45:11.110488630 +0000
@@ -2804,7 +2804,7 @@
 0.6158	1.3762
 select max(key1) from t1 where key1 <= 0.6158 and rand() + 0.5 >= 0.5;
 max(key1)
-0.3845
+0.6158
 select min(key1) from t1 where key1 >= 0.3762 and rand() + 0.5 >= 0.5;
 min(key1)
 0.3845
 
mysqltest: Result content mismatch

main.select                              w2 [ fail ]
        Test ended at 2019-09-07 12:49:22
 
CURRENT_TEST: main.select
--- /usr/share/mysql-test/main/select.result	2019-09-07 09:08:23.000000000 +0000
+++ /dev/shm/var/2/log/select.reject	2019-09-07 12:49:21.943951635 +0000
@@ -2804,7 +2804,7 @@
 0.6158	1.3762
 select max(key1) from t1 where key1 <= 0.6158 and rand() + 0.5 >= 0.5;
 max(key1)
-0.3845
+0.6158
 select min(key1) from t1 where key1 >= 0.3762 and rand() + 0.5 >= 0.5;
 min(key1)
 0.3845
 
mysqltest: Result content mismatch

main.select_jcl6                         w2 [ fail ]
        Test ended at 2019-09-07 12:49:27
 
CURRENT_TEST: main.select_jcl6
--- /usr/share/mysql-test/main/select_jcl6.result	2019-09-07 09:08:23.000000000 +0000
+++ /dev/shm/var/2/log/select_jcl6.reject	2019-09-07 12:49:26.854019423 +0000
@@ -2815,7 +2815,7 @@
 0.6158	1.3762
 select max(key1) from t1 where key1 <= 0.6158 and rand() + 0.5 >= 0.5;
 max(key1)
-0.3845
+0.6158
 select min(key1) from t1 where key1 >= 0.3762 and rand() + 0.5 >= 0.5;
 min(key1)
 0.3845
 
mysqltest: Result content mismatch

main.sp w2 [ fail ]
Test ended at 2019-09-07 12:49:41

CURRENT_TEST: main.sp
/usr/bin/mysqltest: Error on delete of '/dev/shm/var/2/tmp//t1.frm' (Errcode: 2 "No such file or directory")
/usr/bin/mysqltest: Error on delete of '/dev/shm/var/2/tmp//t1.MYD' (Errcode: 2 "No such file or directory")
— /usr/share/mysql-test/main/sp.result 2019-09-07 09:08:23.000000000 +0000
+++ /dev/shm/var/2/log/sp.reject 2019-09-07 12:49:41.434220717 +0000
@@ -5996,9 +5996,9 @@
INSERT INTO t3 VALUES (1, 3.4), (1, 2), (1, 0.9), (2, 8), (2, 7)|
SELECT SUM(f2), bug25373(f1) FROM t3 GROUP BY bug25373(f1) WITH ROLLUP|
SUM(f2) bug25373(f1)
-6.300000071525574 1
+6.299999833106995 1
15 2
-21.300000071525574 NULL
+21.299999833106995 NULL
DROP FUNCTION bug25373|
DROP TABLE t3|
DROP DATABASE IF EXISTS mysqltest1|

mysqltest: Result content mismatch

main.derived_cond_pushdown               w1 [ fail ]
        Test ended at 2019-09-07 12:49:54
 
CURRENT_TEST: main.derived_cond_pushdown
--- /usr/share/mysql-test/main/derived_cond_pushdown.result	2019-09-07 09:08:23.000000000 +0000
+++ /dev/shm/var/1/log/derived_cond_pushdown.reject	2019-09-07 12:49:54.364399231 +0000
@@ -7894,7 +7894,7 @@
             "access_type": "ALL",
             "rows": 3,
             "filtered": 100,
-            "attached_condition": "t1.i = 2.7100000381469727"
+            "attached_condition": "t1.i = 2.7099997997283936"
           }
         }
       }
 
mysqltest: Result content mismatch

main.type_float w2 [ fail ]
Test ended at 2019-09-07 12:50:39

CURRENT_TEST: main.type_float
— /usr/share/mysql-test/main/type_float.result 2019-09-07 09:08:24.000000000 +0000
+++ /dev/shm/var/2/log/type_float.reject 2019-09-07 12:50:39.495022304 +0000
@@ -385,12 +385,12 @@
Warning 1264 Out of range value for column 'f1' at row 2
select f1 + 0e0 from t1;
f1 + 0e0
-1.0000000150474662e29
--1.0000000150474662e29
-1.0000000150474662e30
--1.0000000150474662e30
-1.0000000150474662e30
--1.0000000150474662e30
+9.999999206001366e28
+-9.999999206001366e28
+9.999999394896025e29
+-9.999999394896025e29
+9.999999394896025e29
+-9.999999394896025e29
drop table t1;
create table t1 (c char(6));
insert into t1 values (2e6),(2e-5);
@@ -818,20 +818,20 @@
INSERT INTO t1 VALUES (1.1);
SELECT f FROM t1 UNION SELECT 1;
f
-1.100000023841858
+1.0999999046325684
1
SELECT 1 UNION SELECT f FROM t1;
1
1
-1.100000023841858
+1.0999999046325684
SELECT f FROM t1 UNION SELECT 2147483647;
f
-1.100000023841858
+1.0999999046325684
2147483647
SELECT 2147483647 UNION SELECT f FROM t1;
2147483647
2147483647
-1.100000023841858
+1.0999999046325684
SELECT CASE WHEN 0 THEN (SELECT f FROM t1) ELSE 2147483647 END AS c1,
CASE WHEN 1 THEN 2147483647 ELSE (SELECT f FROM t1) END AS c2;
c1 c2

mysqltest: Result length mismatch

 



 Comments   
Comment by Elena Stepanova [ 2019-09-08 ]

http://buildbot.askmonty.org/buildbot/builders/kvm-rpm-rhel8-ppc64le/builds/121

10.4 c1a2778e689030fcbb6cdc93d8c1f1d8

main.type_newdecimal                     w1 [ fail ]
        Test ended at 2019-09-07 15:45:49
 
CURRENT_TEST: main.type_newdecimal
--- /usr/share/mysql-test/main/type_newdecimal.result	2019-09-07 13:25:53.000000000 +0000
+++ /dev/shm/var/1/log/type_newdecimal.reject	2019-09-07 15:45:49.516362620 +0000
@@ -1170,26 +1170,26 @@
 0.000000000000000000000000117549	1.17549e-25
 0.000000000000000000000001175494	1.17549e-24
 0.000000000000000000000011754943	1.17549e-23
-0.000000000000000000000117549438	1.17549e-22
+0.000000000000000000000117549426	1.17549e-22
 0.000000000000000000001175494332	1.17549e-21
 0.000000000000000000011754943324	1.17549e-20
-0.000000000000000000117549434853	1.17549e-19
-0.000000000000000001175494374380	1.17549e-18
-0.000000000000000011754943743802	1.17549e-17
+0.000000000000000000117549421928	1.17549e-19
+0.000000000000000001175494270983	1.17549e-18
+0.000000000000000011754942916622	1.17549e-17
 0.000000000000000117549432474939	1.17549e-16
 0.000000000000001175494324749389	0.00000000000000117549
-0.000000000000011754943671010362	0.0000000000000117549
+0.000000000000011754942823977415	0.0000000000000117549
 0.000000000000117549429933840040	0.000000000000117549
-0.000000000001175494380653563400	0.00000000000117549
+0.000000000001175494272233346100	0.00000000000117549
 0.000000000011754943372854765000	0.0000000000117549
 0.000000000117549428524377220000	0.000000000117549
-0.000000001175494368510499000000	0.00000000117549
-0.000000011754943685104990000000	0.0000000117549
+0.000000001175494257488196600000	0.00000000117549
+0.000000011754942796926570000000	0.0000000117549
 0.000000117549433298336230000000	0.000000117549
-0.000001175494389826781100000000	0.00000117549
+0.000001175494276139943400000000	0.00000117549
 0.000011754943443520460000000000	0.0000117549
 0.000117549432616215200000000000	0.000117549
-0.001175494398921728100000000000	0.00117549
+0.001175494282506406300000000000	0.00117549
 0.011754943057894707000000000000	0.0117549
 0.117549434304237370000000000000	0.117549
 SELECT CAST(my_double  AS DECIMAL(65,30)), my_double FROM t1;
@@ -1273,26 +1273,26 @@
 0.000000000000000000000000117549	1.17549e-25
 0.000000000000000000000001175494	1.17549e-24
 0.000000000000000000000011754943	1.17549e-23
-0.000000000000000000000117549438	1.17549e-22
+0.000000000000000000000117549426	1.17549e-22
 0.000000000000000000001175494332	1.17549e-21
 0.000000000000000000011754943324	1.17549e-20
-0.000000000000000000117549434853	1.17549e-19
-0.000000000000000001175494374380	1.17549e-18
-0.000000000000000011754943743802	1.17549e-17
+0.000000000000000000117549421928	1.17549e-19
+0.000000000000000001175494270983	1.17549e-18
+0.000000000000000011754942916622	1.17549e-17
 0.000000000000000117549432474939	1.17549e-16
 0.000000000000001175494324749389	0.00000000000000117549
-0.000000000000011754943671010362	0.0000000000000117549
+0.000000000000011754942823977415	0.0000000000000117549
 0.000000000000117549429933840040	0.000000000000117549
-0.000000000001175494380653563400	0.00000000000117549
+0.000000000001175494272233346100	0.00000000000117549
 0.000000000011754943372854765000	0.0000000000117549
 0.000000000117549428524377220000	0.000000000117549
-0.000000001175494368510499000000	0.00000000117549
-0.000000011754943685104990000000	0.0000000117549
+0.000000001175494257488196600000	0.00000000117549
+0.000000011754942796926570000000	0.0000000117549
 0.000000117549433298336230000000	0.000000117549
-0.000001175494389826781100000000	0.00000117549
+0.000001175494276139943400000000	0.00000117549
 0.000011754943443520460000000000	0.0000117549
 0.000117549432616215200000000000	0.000117549
-0.001175494398921728100000000000	0.00117549
+0.001175494282506406300000000000	0.00117549
 0.011754943057894707000000000000	0.0117549
 0.117549434304237370000000000000	0.117549
 UPDATE t1 SET my_decimal = my_double;
 
mysqltest: Result content mismatch

main.type_ranges                         w1 [ fail ]
        Test ended at 2019-09-07 15:45:51
 
CURRENT_TEST: main.type_ranges
--- /usr/share/mysql-test/main/type_ranges.result	2019-09-07 13:25:53.000000000 +0000
+++ /dev/shm/var/1/log/type_ranges.reject	2019-09-07 15:45:51.206386672 +0000
@@ -132,8 +132,8 @@
 11	2	2	2	2	2	2	2.0	2.0000	2	00002	2	2	2	0	NULL	NULL	NULL	NULL	NULL	2	2
 12	0.33333333	3	3	3	3	3	3.0	3.0000	3	00003	3	3	3	0	1997-03-03	10:10:10	1997-03-03 10:10:10				3
 13	-1	-1	-1	-1	-1	-1	-1.0	-1.0000	0	00000	0	0	0	0	1997-08-07	08:07:06	1997-04-03 09:08:07	-1	-1	-1	-1
-14	-429496729	-128	-32768	-8388608	-2147483648	-4294967295	-4294967296.0	-4294967295.0000	0	00000	0	0	0	0	0000-00-00	00:00:00	0000-00-00 00:00:00	-4294967295	-4294967295	-4294967295	-4294967295
-15	4294967295	127	32767	8388607	2147483647	4294967295	4294967296.0	4294967295.0000	255	65535	16777215	4294967295	4294967295	0	0000-00-00	00:00:00	0000-00-00 00:00:00	4294967295	4294967295	4294967295	4294967295
+14	-429496729	-128	-32768	-8388608	-2147483648	-4294967295	-4294967040.0	-4294967295.0000	0	00000	0	0	0	0	0000-00-00	00:00:00	0000-00-00 00:00:00	-4294967295	-4294967295	-4294967295	-4294967295
+15	4294967295	127	32767	8388607	2147483647	4294967295	4294967040.0	4294967295.0000	255	65535	16777215	4294967295	4294967295	0	0000-00-00	00:00:00	0000-00-00 00:00:00	4294967295	4294967295	4294967295	4294967295
 16	hello	1	1	0	0	0	0.0	NULL	0	00000	0	0	0	0	NULL	NULL	NULL	NULL	NULL		
 ALTER TABLE t1
 add new_field char(10) default "new" not null,
 
mysqltest: Result content mismatch

Comment by Marko Mäkelä [ 2019-09-10 ]

A few tests use the floating-point constant 0.6158 = 3079/5000 (3079 is a prime number). As far as I can tell, the binary presentation of 1/5000 expressed as a regular expression is 0b0.000(1[01]{499})\1+. That is, the cycle repeats every 500 bits. That cannot possibly be accurately represented with the 53-bit mantissa of a double, let alone 24-bit mantissa of a float.

Based on my experience of analyzing and fixing MDEV-20531, I believe that tests that use floating-point should aim to use constants that are finite sums of powers of 2. That should create more deterministic results.

For example, 0.6158 should better be replaced with 2523/4096 = 0.615966796875 or 628/1024 = .61328125. Both should easily fit in a float.

Comment by Daniel Black [ 2020-03-20 ]

I tried to reproduce these faults on 10.3 branch and was unable to.

at commit dd68db0c17d674f1b64e70ff7ea9e3f4abe4ee3e

[ozlabs@hab4 mariadb-server-10.3-MDEV-20532]$ more /etc/redhat-release 
Red Hat Enterprise Linux release 8.1 (Ootpa)
[ozlabs@hab4 mariadb-server-10.3-MDEV-20532]$ uname -a
Linux hab4.ozlabs.ibm.com 4.18.0-147.el8.ppc64le #1 SMP Thu Sep 26 15:44:34 UTC 2019 ppc64le ppc64le ppc64le GNU/Linux
...
 
mysql-test/mtr --mem --parallel=80 --big-test  --force --max-test-fail=49
 
Completed: Failed 3/4730 tests, 99.94% were successful.
 
Failing test(s): innodb.innodb_buffer_pool_resize_with_chunks mariabackup.mdev-14447 innodb.alter_large_dml

Comment by Alice Sherepa [ 2020-07-10 ]

recent occurrence on 10.5 http://buildbot.askmonty.org/buildbot/builders/kvm-rpm-rhel8-ppc64le/builds/1385/steps/mtr/logs/stdio

Comment by Alice Sherepa [ 2020-09-08 ]

fails every day on kvm-rpm-rhel8-ppc64le http://buildbot.askmonty.org/buildbot/builders/kvm-rpm-rhel8-ppc64le/builds/1568/steps/mtr-rocksdb/logs/stdio

Comment by Elena Stepanova [ 2022-05-30 ]

Since nothing is happening, from now on the failing tests will be skipped on this builder:

main.ps
main.select_pkeycache
main.sp
main.derived_cond_pushdown
main.select
main.select_jcl6
main.type_float
main.type_newdecimal
main.type_ranges
main.func_math

If it ever gets fixed, please create a TODO task for re-enabling the tests.

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