server icon indicating copy to clipboard operation
server copied to clipboard

Allow MariaDB server to startup past 2038 and continue to verify compatibility with testing in GitLab CI

Open anson1014 opened this issue 10 months ago • 5 comments

Note: This PR is intended to only be merged AFTER the changes in branch bb-11.5-MDEV-32188-timestamps are finalized and merged into mainline 11.5

  • [x] The Jira issue number for this PR is: MDEV-32188

Description

Commits in branch: bb-11.5-MDEV-32188-timestamps made changes to use the entire 32 bit unsigned range in order to support timestamps past 2038-01-20 on 64 bit systems.

Without changing set_max_time on thr_timer to also match this new range, the server will crash when attempting to startup past 2038-01-19. Like the commits in bb-11.5-MDEV-32188-timestamps, the changes only apply to 64 bit systems.

Furthermore, in order to ensure that all future changes preserve the ability for the engine to start and function past the year 2038, a new GitLab MTR run is added which uses libfaketime to simulate starting the server and running the test suite in the future. The job simulates running in two times in the year 2038, once before the signed 32 bit UNIX limit and once after.

Release Notes

  • MariaDB now supports running past the signed 32 bit UNIX timestamp limit 2038-01-19.

How can this PR be tested?

  • ./mtr --suite=main successfully completes both locally and in GitLab CI when running at the present time, in simulated 2038-01-18 and simulated 2038-01-20 while running on branch bb-11.5-MDEV-32188-timestamps

Basing the PR against the correct MariaDB version

  • [x] This is a new feature and the PR is based against the latest MariaDB development branch.

PR quality check

  • [x] I checked the CODING_STANDARDS.md file and my PR conforms to this where appropriate.
  • [x] For any trivial modifications to the PR, I am ok with the reviewer making the changes themselves.

All new code of the whole pull request, including one or several files that are either new files or modified ones, are contributed under the BSD-new license. I am contributing on behalf of my employer Amazon Web Services, Inc.

anson1014 avatar Apr 26 '24 21:04 anson1014

CLA assistant check
Thank you for your submission! We really appreciate it. Like many open source projects, we ask that you sign our Contributor License Agreement before we can accept your contribution.
You have signed the CLA already but the status is still pending? Let us recheck it.

CLAassistant avatar Apr 26 '24 21:04 CLAassistant

The CI is all failing on the mtr main.long_unique_bugs which definitely seems related to the changes in this PR:

main.long_unique_bugs 'innodb'           w5 [ fail ]
        Test ended at 2024-04-26 21:38:41
CURRENT_TEST: main.long_unique_bugs
--- /home/buildbot/amd64-centos-7/build/mysql-test/main/long_unique_bugs.result	2024-04-26 21:25:54.000000000 +0000
+++ /home/buildbot/amd64-centos-7/build/mysql-test/main/long_unique_bugs.reject	2024-04-26 21:38:40.715619054 +0000
@@ -61,7 +61,7 @@
 1	foo
 select pk, f, row_end > DATE'2106-01-01' from t1 for system_time all;
 pk	f	row_end > DATE'2106-01-01'
-1	foo	1
+1	foo	0
 1	foo	0
 1	bar	0
 drop table t1;
mysqltest: Result content mismatch

tonychen2001 avatar Apr 30 '24 18:04 tonychen2001

The CI is all failing on the mtr main.long_unique_bugs which definitely seems related to the changes in this PR:


main.long_unique_bugs 'innodb'           w5 [ fail ]

        Test ended at 2024-04-26 21:38:41

CURRENT_TEST: main.long_unique_bugs

--- /home/buildbot/amd64-centos-7/build/mysql-test/main/long_unique_bugs.result	2024-04-26 21:25:54.000000000 +0000

+++ /home/buildbot/amd64-centos-7/build/mysql-test/main/long_unique_bugs.reject	2024-04-26 21:38:40.715619054 +0000

@@ -61,7 +61,7 @@

 1	foo

 select pk, f, row_end > DATE'2106-01-01' from t1 for system_time all;

 pk	f	row_end > DATE'2106-01-01'

-1	foo	1

+1	foo	0

 1	foo	0

 1	bar	0

 drop table t1;

mysqltest: Result content mismatch

This is because at the moment, the changes which add support for timestamps past 2038 (in this case, specifically for system versioning) in branch bb-11.5-MDEV-32188-timestamps are not merged in mainline yet.

anson1014 avatar Apr 30 '24 19:04 anson1014

This is because at the moment, the changes which add support for timestamps past 2038 (in this case, specifically for system versioning) in branch bb-11.5-MDEV-32188-timestamps are not merged in mainline yet.

Perhaps, this could be targeted onto bb-11.5-MDEV-32188-timestamps? If this got merged into bb-11.5-MDEV-32188-timestamps, you wouldn't need to maintain/rebase this PR if bb-11.5-MDEV-32188-timestamps has further changes and this would definitely help whoever is working on bb-11.5-MDEV-32188-timestamps.

tonychen2001 avatar Apr 30 '24 19:04 tonychen2001

Yes, never mind that. I know it's for bb-11.5-MDEV-32188-timestamps and will take care that it's merged correctly. Either in that branch or in the main after bb-11.5-MDEV-32188-timestamps is pushed

vuvova avatar Apr 30 '24 20:04 vuvova

This was merged via https://github.com/MariaDB/server/commit/eb0c719947df46250ce1f47d8eaa09f972cb041d on MariaDB 11.5.1.

ottok avatar Jul 12 '24 05:07 ottok