test: Give testConcurrentIncrementsWithSelectForUpdate room to retry on MariaDB - #2944
Open
Oleg Babichev (obabichevjb) wants to merge 1 commit into
Open
Oleg Babichev (obabichevjb) wants to merge 1 commit into
Oleg Babichev (obabichevjb) wants to merge 1 commit into
Conversation
This branch has not been deployed
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Description
Summary of the change:
EntityCacheRefreshTests.testConcurrentIncrementsWithSelectForUpdatefails intermittently on CI against MariaDB with error 1020 (
ER_CHECKREAD); this gives itstransactions enough retry attempts and a randomised backoff to absorb the conflict that MariaDB's
innodb_snapshot_isolationnow raises by design.Detailed description:
Why: MariaDB has defaulted
innodb_snapshot_isolationtoONsince 11.6.2 (MDEV-35124), andthe CI container reports
12.1.2-MariaDBwith the settingON. Under it, a locking read of a rowthat has changed since the transaction's snapshot no longer blocks and re-reads — it raises
ER_CHECKREAD, "Record has changed since last read", and rolls the transaction back. MariaDB'sguidance is to restart the transaction.
This test is maximally exposed to that, and by its own design. Its first statement is a deliberate
plain read whose only purpose is to make the DAO cache a stale value, and that read is exactly
what establishes the transaction's snapshot:
The
forUpdate()read immediately after is the locking read. With 20 transactions incrementing asingle row, another transaction committing inside that window is routine rather than exceptional.
So the mechanism the test uses to prove the DAO refreshes its cache is the one that snapshot
isolation rejects.
Type of Change
Please mark the relevant options with an "X":
Affected databases: