Create a new type, topology.connection that implements a subset of the driver.Connection type. This type is a combination of connection.pooledConnection and connection.connection. The topology.pool type should deal directly with this type. There is no Close method on topology.connection, instead the pool.returnConnection or pool.closeConnection method should be used.
This type is also responsible for handling wire message compression, as the connection.connection type did. Since wire message compression requires knowledge of the command being run, this logic should be handled inside of the driver package. This can likely be consolidated into the driver.OperationContext type which can check for compression right after the command is appended onto the wire message.
SDAM error handling should also be handled by this type. This is different from the previous implementation since error extraction occurs in the driver package. We should directly inspect the wire message bytes to determine if there was a command error (including write concern errors) and update the server description and drain the
pool as required. The original design had SDAM error processing handled by the connection implementation, but this forces double decoding of wire messages, which can be expensive. Instead, we make a new interface in the driver package called ErrorProcessor. If a Server implements ErrorProcessor then it's ProcessError method will be called with the error that comes from decoding the wire message.
- has to be done before
-
GODRIVER-929 Create topology.pool type
- Closed
-
GODRIVER-931 Implement topology.legacyConnection type
- Closed
-
GODRIVER-932 Update topology.Server type
- Closed
-
GODRIVER-960 Implement SDAM error handling in topology.connection
- Closed