-
Type: New Feature
-
Resolution: Done
-
Priority: Major - P3
-
Affects Version/s: None
-
Component/s: Networking
-
Fully Compatible
-
Platforms 2018-06-04, Platforms 2018-06-18
Sometimes application developers and support engineers need to correlate what's happening in their application with activity in the database, and one easy way to do this would be if drivers could log the server's connectionId for outgoing messages, something like:
... inserting 3 documents: server [localhost:27017], connection [conn2400]
and correlate it with a server log message like:
Sat Aug 24 00:59:05.598 [conn2400] insert ... ninserted:1 keyUpdates:0 locks(micros) w:313952 313ms
It would also be useful to include the connectionId with any exception thrown by a driver.
Currently the only command that will return this connectionId is "getlasterror". While drivers can use this (by calling it after connecting and caching the result), it's not ideal. For one, "getlasterror" is likely to be removed in a future release. For another, the server will log this call, and it may confuse people that getlasterror is being called after every connect.
So the request is to provide some other supported mechanism that will provide the server's connectionId to clients.
A good solution would be to add the connectionId to the isMaster response. Drivers are already calling isMaster and therefore would be able to discover the server's connectionId without having to issue a separate command requiring an additional network round trip.
- depends on
-
SERVER-24611 Implement ClientMetadata class
- Closed
- is depended on by
-
CSHARP-4014 Remove code to run `getLastError` command once minimum supported server is 4.2
- Backlog
-
CSHARP-2571 Prefer connectionId from isMaster response to connectionid from getLastError response
- Closed
-
JAVA-1109 Allow killing of ops
- Closed
-
JAVA-3255 Prefer connectionId from isMaster response to connectionid from getLastError response
- Closed
- is related to
-
DRIVERS-360 Could the server remove support for getLastError?
- Closed
-
DRIVERS-2106 Include local ephemeral port in APM command callbacks
- Backlog