[JAVA-3255] Prefer connectionId from isMaster response to connectionid from getLastError response Created: 02/Apr/19 Updated: 28/Oct/23 Resolved: 05/Apr/19 |
|
| Status: | Closed |
| Project: | Java Driver |
| Component/s: | Connection Management |
| Affects Version/s: | None |
| Fix Version/s: | 3.11.0 |
| Type: | Improvement | Priority: | Major - P3 |
| Reporter: | Jeffrey Yemin | Assignee: | Jeffrey Yemin |
| Resolution: | Fixed | Votes: | 0 |
| Labels: | None | ||
| Remaining Estimate: | Not Specified | ||
| Time Spent: | Not Specified | ||
| Original Estimate: | Not Specified | ||
| Issue Links: |
|
||||||||||||
| Server Compat: | 4.1 | ||||||||||||
| Description |
|
The Java driver currently executes the getLastError command as part of the server handshake, in order to get the connectionId from its response. This is useful for logging and monitoring connection use and correlating with server log files. As of 4.2, the server will return the connectionId in the isMaster response, which the driver has to execute anyway on every connection. If the driver detects a connectionId in the isMaster response, it should just use it and not execute getLastError. |
| Comments |
| Comment by Githook User [ 05/Apr/19 ] |
|
Author: {'name': 'Jeff Yemin', 'username': 'jyemin', 'email': 'jeff.yemin@10gen.com'}Message: Get server connectionId from isMaster if possible As of MongoDB 4.2, the isMaster response includes the connectionId.
|