Skip to content

[2.5.x] Fix CI: exact MongoDB image tags, driver 5.14.0 with the 5.12+ session fixes, servers 7.0+ - #4428

Merged
evanchooly merged 3 commits into
2.5.xfrom
2.5.x-mongo-image-tags
Oct 31, 2026
Merged

evanchooly merged 3 commits into
2.5.xfrom
2.5.x-mongo-image-tags

Conversation

@evanchooly

@evanchooly evanchooly commented Oct 30, 2026 •

Copy link
Copy Markdown
Member

Backport of #4404 to 2.5.x. Unblocks CI: Dependabot PRs on this branch fail in MorphiaTestSetup.initMongoDbContainer with Container startup failed for image mongo:8 … Container exited with code 1.

Cause

  • mongo:8 now 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.
  • MorphiaTestSetup built the image tag from the major version only, so every matrix entry and the default ran mongo:8.

Changes

  • Exact image tags. -Dmongodb is used as given (mongo:8.2.12, or mongo:8.2 for a line's latest). Sharded tests go through the same path.
  • New default. 8.2 instead of major 8.
  • Matrix filter. BuildMatrix skips 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.13 reproduces the kernel error locally (kernel 7.0); mongo:8.2 (8.2.12) starts.
  • TestSharding and MorphiaCodecProviderTest pass on mongo: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.testTransactions failed (backport of #4340 and #4345)

  • Cause. Driver 5.12 allows one open command per session. Decoding an entity inside a session resolves eager @References with a nested find on the same session, so the driver failed with an AssertionError in SpecRetryPolicy$...$Overload.
  • DeferredDecoding. Within a MorphiaSessionImpl, query, findAndDelete, modify and aggregation reads fetch RawBsonDocuments and decode them after the driver returns them.
  • MorphiaMapCodecProvider. No longer claims RawBsonDocument. It returned a BsonDocumentCodec for every BsonDocument subclass, which turned raw reads into plain BsonDocuments. 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. driver.version 5.11.1 → 5.14.0; driver.minor.version 5.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.34 or mongo:6.0.29 images. BuildMatrix now starts at 7.0, as on master: ['9.0.4', '8.2.12', '7.0.45'].

More testing

  • Full morphia-core suite on driver 5.14.0 / mongo:8.2: 967 tests, 0 failures.
  • TestTransactions with surefire:test on drivers 5.11.1 and 5.0.1, compiled against 5.14 as in CI: 14 tests, 0 failures each.

…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.
Copilot AI balanced review requested due to automatic review settings October 30, 2026 20:29

Copilot AI left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

🟢 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 -Dmongodb value as the image tag for standalone and sharded tests.
  • Changes the default MongoDB image tag to 8.2.
  • Excludes exactly 8.0.34 and 8.3.13 from 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.
@evanchooly evanchooly changed the title [2.5.x] Test against the requested MongoDB version; skip releases that can't start on new kernels [2.5.x] Fix CI: exact MongoDB image tags, driver 5.14.0 with the 5.12+ session fixes, servers 7.0+ Oct 30, 2026
@evanchooly
evanchooly merged commit a0430c3 into 2.5.x Oct 31, 2026
42 checks passed
@evanchooly
evanchooly deleted the 2.5.x-mongo-image-tags branch October 31, 2026 15:51
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants