Details
-
Bug
-
Status: Open (View Workflow)
-
Minor
-
Resolution: Unresolved
-
10.5.27
-
None
-
None
Description
When reviewing code, I discovered that Master_info::heartbeat_period is a float.
Yes, the 0.1 * 3 != 0.3 kind of float.
Modding MTR test rpl.rpl_heartbeat_basic, I can confirm that it indeed only supports 7 decimal digits:
- 4294966.999 shows up as 4294967.000 in both SHOW STATUS and SHOW REPLICA STATUS.
- 4294967.001 does not trigger the “4294967 exceeded” error (whereas “4294967.999” does).
The test (with the expected .result, not actual): https://github.com/MariaDB/server/compare/10.5...mdev-35879.test
This variable should be a double for enough precision or, better, a DECIMAL(10, 3) (or internally stored as a uint32_t of milliseconds).
Attachments
Activity
Field | Original Value | New Value |
---|---|---|
Description |
When [reviewing code|https://github.com/MariaDB/server/pull/3772#discussion_r1919452564], I discovered that {{Master_info::heartbeat_period}} is a {{float}}.
Yes, the {{0.1 * 3 != 0.3}} kind of {{float}}. Modding MTR test {{rpl.rpl_heartbeat_basic}}, I can confirm that it indeed only supports 7 decimal digits: * 4294966.999 shows up as 4294967.000 in both SHOW STATUS and SHOW REPLICA STATUS. * 4294967.001 does not trigger the “4294967 exceeded” error (whereas “4294967.999” does). This variable should be a {{double}} for enough precision or, better, a {{DECIMAL(10, 3)}} (or internally stored as a {{uint32_t}} of milliseconds). |
When [reviewing code|https://github.com/MariaDB/server/pull/3772#discussion_r1919452564], I discovered that {{Master_info::heartbeat_period}} is a {{float}}.
Yes, the {{0.1 * 3 != 0.3}} kind of {{float}}. [Modding MTR test {{rpl.rpl_heartbeat_basic}}|https://github.com/MariaDB/server/compare/10.5...mdev-35879.test], I can confirm that it indeed only supports 7 decimal digits: * 4294966.999 shows up as 4294967.000 in both SHOW STATUS and SHOW REPLICA STATUS. * 4294967.001 does not trigger the “4294967 exceeded” error (whereas “4294967.999” does). This variable should be a {{double}} for enough precision or, better, a {{DECIMAL(10, 3)}} (or internally stored as a {{uint32_t}} of milliseconds). |
Description |
When [reviewing code|https://github.com/MariaDB/server/pull/3772#discussion_r1919452564], I discovered that {{Master_info::heartbeat_period}} is a {{float}}.
Yes, the {{0.1 * 3 != 0.3}} kind of {{float}}. [Modding MTR test {{rpl.rpl_heartbeat_basic}}|https://github.com/MariaDB/server/compare/10.5...mdev-35879.test], I can confirm that it indeed only supports 7 decimal digits: * 4294966.999 shows up as 4294967.000 in both SHOW STATUS and SHOW REPLICA STATUS. * 4294967.001 does not trigger the “4294967 exceeded” error (whereas “4294967.999” does). This variable should be a {{double}} for enough precision or, better, a {{DECIMAL(10, 3)}} (or internally stored as a {{uint32_t}} of milliseconds). |
When [reviewing code|https://github.com/MariaDB/server/pull/3772#discussion_r1919452564], I discovered that {{Master_info::heartbeat_period}} is a {{float}}.
Yes, the {{0.1 * 3 != 0.3}} kind of {{float}}. Modding MTR test {{rpl.rpl_heartbeat_basic}}, I can confirm that it indeed only supports 7 decimal digits: * 4294966.999 shows up as 4294967.000 in both SHOW STATUS and SHOW REPLICA STATUS. * 4294967.001 does not trigger the “4294967 exceeded” error (whereas “4294967.999” does). The test (with the _expected_ {{.result}}, not _actual_): https://github.com/MariaDB/server/compare/10.5...mdev-35879.test This variable should be a {{double}} for enough precision or, better, a {{DECIMAL(10, 3)}} (or internally stored as a {{uint32_t}} of milliseconds). |