OpenSearch icon indicating copy to clipboard operation
OpenSearch copied to clipboard

Bump com.maxmind.db:maxmind-db from 3.2.0 to 4.0.0 in /modules/ingest-geoip

Open dependabot[bot] opened this issue 1 month ago • 9 comments

Bumps com.maxmind.db:maxmind-db from 3.2.0 to 4.0.0.

Release notes

Sourced from com.maxmind.db:maxmind-db's releases.

4.0.0

This is a major release with several breaking changes. Please see https://github.com/maxmind/MaxMind-DB-Reader-java/blob/HEAD/UPGRADING.md for detailed migration instructions.

  • Java 17 or greater is now required.
  • Added support for MaxMind DB files larger than 2GB. The library now uses an internal Buffer abstraction that can handle databases exceeding the 2GB ByteBuffer limit. Files under 2GB continue to use a single ByteBuffer for optimal performance. Requested by nonetallt. GitHub #154. Fixed by Silvano Cerza. GitHub #289.
  • Metadata.getBuildDate() has been replaced with buildTime(), which returns java.time.Instant instead of java.util.Date. The instant represents the database build time in UTC.
  • DatabaseRecord, Metadata, Network, and internal DecodedValue classes have been converted to records. The following API changes were made:
    • DatabaseRecord.getData() and DatabaseRecord.getNetwork() have been replaced with record accessor methods data() and network().
    • Simple getter methods on Metadata (e.g., getBinaryFormatMajorVersion(), getDatabaseType(), etc.) have been replaced with their corresponding record accessor methods (e.g., binaryFormatMajorVersion(), databaseType(), etc.).
    • Network.getNetworkAddress() and Network.getPrefixLength() have been replaced with record accessor methods networkAddress() and prefixLength().
    • Removed the legacy DatabaseRecord(T, InetAddress, int) constructor; pass a Network when constructing records manually.
  • Deserialization improvements:
    • If no constructor is annotated with @MaxMindDbConstructor, records now use their canonical constructor automatically. For non‑record classes with a single public constructor, that constructor is used by default.
    • @MaxMindDbParameter annotations are now optional when parameter names match field names in the database: for records, component names are used; for classes, Java parameter names are used (when compiled with -parameters). Annotations still take precedence when present.
    • Added @MaxMindDbIpAddress and @MaxMindDbNetwork annotations to inject the lookup IP address and resulting network into constructors. Annotation metadata is cached per type to avoid repeated reflection overhead.
Changelog

Sourced from com.maxmind.db:maxmind-db's changelog.

4.0.0 (2025-11-10)

This is a major release with several breaking changes. Please see https://github.com/maxmind/MaxMind-DB-Reader-java/blob/main/UPGRADING.md for detailed migration instructions.

  • Java 17 or greater is now required.
  • Added support for MaxMind DB files larger than 2GB. The library now uses an internal Buffer abstraction that can handle databases exceeding the 2GB ByteBuffer limit. Files under 2GB continue to use a single ByteBuffer for optimal performance. Requested by nonetallt. GitHub #154. Fixed by Silvano Cerza. GitHub #289.
  • Metadata.getBuildDate() has been replaced with buildTime(), which returns java.time.Instant instead of java.util.Date. The instant represents the database build time in UTC.
  • DatabaseRecord, Metadata, Network, and internal DecodedValue classes have been converted to records. The following API changes were made:
    • DatabaseRecord.getData() and DatabaseRecord.getNetwork() have been replaced with record accessor methods data() and network().
    • Simple getter methods on Metadata (e.g., getBinaryFormatMajorVersion(), getDatabaseType(), etc.) have been replaced with their corresponding record accessor methods (e.g., binaryFormatMajorVersion(), databaseType(), etc.).
    • Network.getNetworkAddress() and Network.getPrefixLength() have been replaced with record accessor methods networkAddress() and prefixLength().
    • Removed the legacy DatabaseRecord(T, InetAddress, int) constructor; pass a Network when constructing records manually.
  • Deserialization improvements:
    • If no constructor is annotated with @MaxMindDbConstructor, records now use their canonical constructor automatically. For non‑record classes with a single public constructor, that constructor is used by default.
    • @MaxMindDbParameter annotations are now optional when parameter names match field names in the database: for records, component names are used; for classes, Java parameter names are used (when compiled with -parameters). Annotations still take precedence when present.
    • Added @MaxMindDbIpAddress and @MaxMindDbNetwork annotations to inject the lookup IP address and resulting network into constructors. Annotation metadata is cached per type to avoid repeated reflection overhead.
Commits
  • 73d600c Preparing for 4.0.0
  • bad6ed5 Prepare documentation for 4.0.0 release
  • 0a08799 Merge pull request #314 from maxmind/dependabot/maven/org.junit.jupiter-junit...
  • 2e12f94 Bump org.junit.jupiter:junit-jupiter from 6.0.0 to 6.0.1
  • 158a84b Merge pull request #313 from maxmind/greg/eng-3236
  • 02d85c9 Set Dependabot cooldown period to 4 days
  • 7d6d8d0 Merge pull request #312 from maxmind/dependabot/maven/com.puppycrawl.tools-ch...
  • 5ebaf90 Bump com.puppycrawl.tools:checkstyle from 12.1.0 to 12.1.1
  • 1013dc6 Merge pull request #309 from maxmind/greg/eng-3230
  • 1d28478 Optimize UINT64/UINT128 decoding to avoid BigInteger allocation
  • Additional commits viewable in compare view

Dependabot compatibility score

Dependabot will resolve any conflicts with this PR as long as you don't alter it yourself. You can also trigger a rebase manually by commenting @dependabot rebase.


Dependabot commands and options

You can trigger Dependabot actions by commenting on this PR:

  • @dependabot rebase will rebase this PR
  • @dependabot recreate will recreate this PR, overwriting any edits that have been made to it
  • @dependabot merge will merge this PR after your CI passes on it
  • @dependabot squash and merge will squash and merge this PR after your CI passes on it
  • @dependabot cancel merge will cancel a previously requested merge and block automerging
  • @dependabot reopen will reopen this PR if it is closed
  • @dependabot close will close this PR and stop Dependabot recreating it. You can achieve the same result by closing it manually
  • @dependabot show <dependency name> ignore conditions will show all of the ignore conditions of the specified dependency
  • @dependabot ignore this major version will close this PR and stop Dependabot creating any more for this major version (unless you reopen the PR or upgrade to it yourself)
  • @dependabot ignore this minor version will close this PR and stop Dependabot creating any more for this minor version (unless you reopen the PR or upgrade to it yourself)
  • @dependabot ignore this dependency will close this PR and stop Dependabot creating any more for this dependency (unless you reopen the PR or upgrade to it yourself)

dependabot[bot] avatar Nov 17 '25 13:11 dependabot[bot]

:x: Gradle check result for 26173ee203b7dab7deaa932d78bb15c34f25e7e0: FAILURE

Please examine the workflow log, locate, and copy-paste the failure(s) below, then iterate to green. Is the failure a flaky test unrelated to your change?

github-actions[bot] avatar Nov 17 '25 13:11 github-actions[bot]

:x: Gradle check result for 83f2ae820128d780eb645f14f4fab90e59cff25d: FAILURE

Please examine the workflow log, locate, and copy-paste the failure(s) below, then iterate to green. Is the failure a flaky test unrelated to your change?

github-actions[bot] avatar Nov 18 '25 19:11 github-actions[bot]

Probably need to find replacement classes which were replaced in later version:

java.lang.NoSuchMethodError: 'java.lang.String com.maxmind.db.Metadata.getDatabaseType()'

Putting up a good first issue label in case anyone wants to take a first pass to fix this.

sandeshkr419 avatar Nov 18 '25 19:11 sandeshkr419

@sandeshkr419 I'd like to work on this. Can you assign me?

tigermint avatar Nov 19 '25 09:11 tigermint

Thanks @tigermint - I have assigned this to you.

Once you are able to fix and we are able to merge your changes, I will close this PR in favor of your changes.

sandeshkr419 avatar Nov 20 '25 01:11 sandeshkr419

@sandeshkr419 I have taken a look at this problem. Below are my finding and things that need to be fixed in order to migrate from 3.2.0 to 4.0.0. I have used this link for your reference. As per the document, .getDatabaseType() has been changed to .databaseType(). Can you please take a look once if possible.

519353424-53b60772-02cd-4013-8c4c-009d95e40677

As you can see in the above image we are getting a error in testLazyLoading and testLoadingCustomDatabase in GeoIpProcessorFactoryTests on line 119 in file DatabaseReader.java ( com/maxmind/geoip2/DatabaseReader.java) , which is because of the the function called in line 115 in the DatabaseReader.java ( com/maxmind/geoip2/DatabaseReader.java). This is because the build function getting called on line 165 in IngestGeoIpModulePlugin.java which in turn is getting called on line 155 in file DatabaseReaderLazyLoader.java. I am not able to find a way to resolve the error as DatabaseReader.java in read-only file.

Other errors are also due to the same issue in getDataBaseType() function in com/maxmind/geoip2/DatabaseReader.java.

It seems that until the geoip -> com.maxmind.geoip2:geoip2:4.4.0 dependency is not updated to be compatible with com.maxmind.db:maxmind-db 4.0.0, we will not be able to update it to 4.0.0 from 3.2.0.

Requesting you to please confirm once.

MeetPatel2209 avatar Nov 27 '25 16:11 MeetPatel2209

Thanks @MeetPatel2209 for taking a look.

It seems that until the geoip -> com.maxmind.geoip2:geoip2:4.4.0 dependency is not updated to be compatible with com.maxmind.db:maxmind-db 4.0.0, we will not be able to update it to 4.0.0 from 3.2.0.

Is it feasible to upgrade this (com.maxmind.geoip2:geoip2:4.4.0) dependency as well?

sandeshkr419 avatar Nov 28 '25 07:11 sandeshkr419

Thanks @MeetPatel2209 for taking a look.

It seems that until the geoip -> com.maxmind.geoip2:geoip2:4.4.0 dependency is not updated to be compatible with com.maxmind.db:maxmind-db 4.0.0, we will not be able to update it to 4.0.0 from 3.2.0.

Is it feasible to upgrade this (com.maxmind.geoip2:geoip2:4.4.0) dependency as well?

@sandeshkr419 I took a look at the (com.maxmind.geoip2:geoip2) dependency and saw that the latest version for this is 5.0.0 which was released on 20th November, 2025 which contains support for the com.maxmind.db:maxmind-db 4.0.0 dependency as seen below in the same DatabaseReader.java class. Hence the errors related to DatabaseReader.java and method not defined are no longer occurring.

Same lines of code in DatabaseReader.java are updated as per com.maxmind.db:maxmind-db 4.0.0 ( databaseType()) : Screenshot from 2025-11-29 00-26-36

Latest version of com.maxmind.geoip2:geoip2 : Screenshot from 2025-11-28 23-51-41

But on using this latest version for both the dependencies, I am facing below errors. It seems that the class AbstractResponse has been removed from package com.maxmind.geoip2.model which causing errors in compilation of the IngestGeoIpModulePlugin.java file. So we might need to refactor the IngestGeoIpModulePlugin.java class to accommodate the newer versions of the dependencies.

Screenshot from 2025-11-28 23-51-11

Requesting you to take a look.

MeetPatel2209 avatar Nov 28 '25 19:11 MeetPatel2209

@sandeshkr419 any action that is required for this issue or some other issue that I can pick up if possible?

MeetPatel2209 avatar Dec 04 '25 15:12 MeetPatel2209