Uploaded image for project: 'Java Driver'
  1. Java Driver
  2. JAVA-4846

ConnectionId returned in heartbeats may be int64

    • Type: Icon: Improvement Improvement
    • Resolution: Done
    • Priority: Icon: Minor - P4 Minor - P4
    • 5.0.0
    • Affects Version/s: None
    • Component/s: Monitoring
    • Labels:
      None
    • Hide

      DRIVERS-2503:
      The connectionId in the hello (or legacy hello) response can be an int32, double, or int64. Many drivers assume an int32, which may result in connectionId truncation or connection failure. Drivers should ensure that the server's connectionId (and the client connectionId for consistency) is expressed as a numeric type capable of holding an int64.

      NOTE: If the client and server connectionId fields are part of the driver's public API, you may have to add new int64 connectionId fields and deprecate the existing int32 fields. On the next major version bump, the deprecated int32 fields should be removed.

      Show
      DRIVERS-2503 : The connectionId in the hello (or legacy hello) response can be an int32 , double , or int64 . Many drivers assume an int32 , which may result in connectionId truncation or connection failure. Drivers should ensure that the server's connectionId (and the client connectionId for consistency) is expressed as a numeric type capable of holding an int64 . NOTE: If the client and server connectionId fields are part of the driver's public API, you may have to add new int64 connectionId fields and deprecate the existing int32 fields. On the next major version bump, the deprecated int32 fields should be removed.
    • Major Change
    • Needed
    • Hide

      We made breaking changes, and should mention them in What's new:

      • The constructor of `com.mongodb.connection.ConnectionId` now takes `long` and `Long` as the types of the second and third parameters respectively. This change breaks binary compatibility (the existing compiled code that call this constructor has to be recompiled; no source code changes are needed).
      • The method `com.mongodb.connection.ConnectionId.withServerValue` now takes `long` instead of `int`. The consequences of this change are the same as for the previous one.
      • The methods `com.mongodb.connection.ConnectionId.getLocalValue` and `getServerValue` now return `long` and `Long` respectively instead of `int` and `Integer`. This change breaks both binary and source compatibility (the source code that uses these methods has to be updated).
      Show
      We made breaking changes, and should mention them in What's new: The constructor of `com.mongodb.connection.ConnectionId` now takes `long` and `Long` as the types of the second and third parameters respectively. This change breaks binary compatibility (the existing compiled code that call this constructor has to be recompiled; no source code changes are needed). The method `com.mongodb.connection.ConnectionId.withServerValue` now takes `long` instead of `int`. The consequences of this change are the same as for the previous one. The methods `com.mongodb.connection.ConnectionId.getLocalValue` and `getServerValue` now return `long` and `Long` respectively instead of `int` and `Integer`. This change breaks both binary and source compatibility (the source code that uses these methods has to be updated).

      This ticket was split from DRIVERS-2503, please see that ticket for a detailed description.

            Assignee:
            valentin.kovalenko@mongodb.com Valentin Kavalenka
            Reporter:
            dbeng-pm-bot PM Bot
            Votes:
            0 Vote for this issue
            Watchers:
            2 Start watching this issue

              Created:
              Updated:
              Resolved: