Repository navigation
[2.5.x] Fix CI: exact MongoDB image tags, driver 5.14.0 with the 5.12+ session fixes, servers 7.0+ - #4428
Merged
Conversation
…start on new kernels Backport of #4404. mongo:8 now resolves to 8.3.13, which refuses to start on Linux 6.19 and newer (SERVER-121912), so every build fails before any test runs. MorphiaTestSetup now uses -Dmongodb as the exact image tag instead of only its major version, and defaults to 8.2. BuildMatrix skips 8.0.34 and 8.3.13, which have the same kernel check.
Contributor
There was a problem hiding this comment.
🟢 Approval recommended
There are no active review issues for the MongoDB test-version backport.
No open issues 🎉
What changed in this PR
Backports the MongoDB test-version fixes to 2.5.x, restoring accurate version coverage and avoiding releases known to fail on newer Linux kernels.
Changes:
- Uses the full
-Dmongodbvalue as the image tag for standalone and sharded tests. - Changes the default MongoDB image tag to
8.2. - Excludes exactly
8.0.34and8.3.13from the CI matrix, allowing later patch releases automatically.
| File | Description |
|---|---|
core/src/test/java/dev/morphia/test/MorphiaTestSetup.java |
Preserves requested image tags and defaults to MongoDB 8.2. |
.github/BuildMatrix.java |
Filters out the two releases affected by the kernel startup issue. |
Review effort: Balanced
…n fixes Backport of #4340 and #4345. Driver 5.12 tracks overload retries per session and allows only one open command per session. Decoding an entity inside a session can resolve an eager @reference with a nested find on the same session, so TestTransactions failed on every 5.12+ driver. - DeferredDecoding: within a MorphiaSessionImpl, query, findAndDelete, modify and aggregation reads fetch RawBsonDocuments and decode them after the driver returns them, so nested reference queries run outside the driver's command. - MorphiaMapCodecProvider no longer claims RawBsonDocument. It returned a BsonDocumentCodec for every BsonDocument subclass, so raw reads came back as plain BsonDocuments. - MorphiaSessionImpl implements getOverloadRetryPolicyState, which 5.12 added to ClientSession. - driver.version 5.11.1 -> 5.14.0; driver.minor.version 5.7 -> 5.14.
Docker Hub has no images for MongoDB 4.4.31, 5.0.34 or 6.0.29, the latest releases MongoDB lists for those lines, so their Server jobs fail pulling the image now that tags are exact. Master already starts the matrix at 7.0.
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.
Backport of #4404 to
2.5.x. Unblocks CI: Dependabot PRs on this branch fail inMorphiaTestSetup.initMongoDbContainerwithContainer startup failed for image mongo:8 … Container exited with code 1.Cause
mongo:8now resolves to MongoDB 8.3.13, which refuses to start on Linux 6.19 and newer (SERVER-121912). 8.0.34 has the same check.MorphiaTestSetupbuilt the image tag from the major version only, so every matrix entry and the default ranmongo:8.Changes
-Dmongodbis used as given (mongo:8.2.12, ormongo:8.2for a line's latest). Sharded tests go through the same path.8.2instead of major8.BuildMatrixskips exactly 8.0.34 and 8.3.13, giving['9.0.4', '8.2.12', '7.0.45', '6.0.29', '5.0.34', '4.4.31'].Testing
mongo:8.3.13reproduces the kernel error locally (kernel 7.0);mongo:8.2(8.2.12) starts.TestShardingandMorphiaCodecProviderTestpass onmongo:8.2(standalone and sharded containers). Full suite not run locally.Also in this PR
With MongoDB starting again, two more failures showed up in the full matrix (run 41123680732).
Driver 5.12+:
TestTransactions.testTransactionsfailed (backport of #4340 and #4345)@References with a nested find on the same session, so the driver failed with anAssertionErrorinSpecRetryPolicy$...$Overload.DeferredDecoding. Within aMorphiaSessionImpl, query,findAndDelete,modifyand aggregation reads fetchRawBsonDocuments and decode them after the driver returns them.MorphiaMapCodecProvider. No longer claimsRawBsonDocument. It returned aBsonDocumentCodecfor everyBsonDocumentsubclass, which turned raw reads into plainBsonDocuments. Master doesn't have this code, so Decode session query results after the driver returns them (fixes driver 5.12+ transaction failures) #4340 didn't need the change.MorphiaSessionImpl.getOverloadRetryPolicyState(). Delegates to the wrapped session.driver.version5.11.1 → 5.14.0;driver.minor.version5.7 → 5.14. Let Dependabot update the MongoDB driver on 2.5.x past 5.11 #4430 lifts the Dependabot cap at 5.12; merge it after this PR.Servers 4.4–6.0: no Docker images
Docker Hub has no
mongo:4.4.31,mongo:5.0.34ormongo:6.0.29images.BuildMatrixnow starts at 7.0, as on master:['9.0.4', '8.2.12', '7.0.45'].More testing
morphia-coresuite on driver 5.14.0 /mongo:8.2: 967 tests, 0 failures.TestTransactionswithsurefire:teston drivers 5.11.1 and 5.0.1, compiled against 5.14 as in CI: 14 tests, 0 failures each.