[JAVA-5186] Change server pinning implementation to not rely on Cluster#getDescription Created: 01/Oct/23 Updated: 28/Oct/23 Resolved: 04/Oct/23 |
|
| Status: | Closed |
| Project: | Java Driver |
| Component/s: | Internal |
| Affects Version/s: | None |
| Fix Version/s: | 4.11.0 |
| Type: | Improvement | Priority: | Unknown |
| Reporter: | Jeffrey Yemin | Assignee: | Jeffrey Yemin |
| Resolution: | Fixed | Votes: | 0 |
| Labels: | None | ||
| Remaining Estimate: | Not Specified | ||
| Time Spent: | Not Specified | ||
| Original Estimate: | Not Specified | ||
| Backwards Compatibility: | Fully Compatible |
| Documentation Changes: | Not Needed |
| Documentation Changes Summary: | 1. What would you like to communicate to the user about this feature? |
| Description |
|
The current implementation of server address pinning for transactions on sharded and load-balanced clusters relies on the Cluster#getDescription method. This means that blocking has to be done twice instead of just once via Cluster#selectServer. It would be easy to refactor so that the cluster type (which is all that is needed) is derived instead from the ConnectionSource after it's selected. This would simplify the code, allow the removal of Cluster#getDescription, and make server selection timeout logging and exception message more consistent. |
| Comments |
| Comment by Githook User [ 04/Oct/23 ] |
|
Author: {'name': 'Jeff Yemin', 'email': 'jeff.yemin@mongodb.com', 'username': 'jyemin'}Message: Refactor transaction server pinning (#1211)
|