Skip to content

Commit f9e5391

Browse files
revert special case for 2 servers
1 parent a617677 commit f9e5391

File tree

1 file changed

+0
-13
lines changed

1 file changed

+0
-13
lines changed

src/sdam/topology.ts

Lines changed: 0 additions & 13 deletions
Original file line numberDiff line numberDiff line change
@@ -903,19 +903,6 @@ function processWaitQueue(topology: Topology) {
903903
continue;
904904
} else if (selectedDescriptions.length === 1) {
905905
selectedServer = topology.s.servers.get(selectedDescriptions[0].address);
906-
} else if (selectedDescriptions.length === 2) {
907-
const server1 = topology.s.servers.get(selectedDescriptions[0].address);
908-
const server2 = topology.s.servers.get(selectedDescriptions[1].address);
909-
910-
if (server1 && server2) {
911-
if (server1.s.operationCount === server2.s.operationCount) {
912-
// If there are only two servers, we avoid shuffling the array of
913-
// server descriptions
914-
selectedServer = Math.floor(Math.random() * 2) === 0 ? server1 : server2;
915-
} else {
916-
selectedServer = server1.s.operationCount < server2.s.operationCount ? server1 : server2;
917-
}
918-
}
919906
} else {
920907
const descriptions = shuffle(selectedDescriptions, 2);
921908
const server1 = topology.s.servers.get(descriptions[0].address);

0 commit comments

Comments
 (0)