Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

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

Open
wants to merge 2 commits into
base: 11.5
Choose a base branch
from

Conversation

anson1014
Copy link
Contributor

@anson1014 anson1014 commented Apr 26, 2024

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

  • 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

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

PR quality check

  • I checked the CODING_STANDARDS.md file and my PR conforms to this where appropriate.
  • 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.

In previous commits, changes were made to use the entire 32 bit
unsigned range in order to support timestamps past 2038 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 previous commits, this only
applies to 64 bit systems.

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.
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. This change
helps to ensure that all future changes preserve the ability for the
engine start and function past the year 2038.

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.
@CLAassistant
Copy link

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.

@anson1014 anson1014 changed the title 11.5 startup engine Allow MariaDB server to startup past 2038 and continue to verify compatibility with testing in GitLab CI Apr 26, 2024
@tonychen2001
Copy link

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

@anson1014
Copy link
Contributor Author

anson1014 commented Apr 30, 2024

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.

@tonychen2001
Copy link

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.

@vuvova
Copy link
Member

vuvova commented Apr 30, 2024

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 vuvova self-assigned this May 15, 2024
@vuvova vuvova self-requested a review May 15, 2024 08:30
vuvova pushed a commit that referenced this pull request May 16, 2024
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. This change
helps to ensure that all future changes preserve the ability for the
engine start and function past the year 2038.

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.

Fixes #3228
vuvova pushed a commit that referenced this pull request May 17, 2024
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. This change
helps to ensure that all future changes preserve the ability for the
engine start and function past the year 2038.

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.

Fixes #3228
vuvova pushed a commit that referenced this pull request May 19, 2024
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. This change
helps to ensure that all future changes preserve the ability for the
engine start and function past the year 2038.

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.

Fixes #3228
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
4 participants