Skip to content

Commit 3f953a1

Browse files
committed
fix(NODE-3521): remove extra server selection
1 parent a0dfc5b commit 3f953a1

File tree

2 files changed

+0
-19
lines changed

2 files changed

+0
-19
lines changed

src/operations/execute_operation.ts

-8
Original file line numberDiff line numberDiff line change
@@ -77,14 +77,6 @@ export function executeOperation<
7777
}
7878

7979
return maybePromise(callback, cb => {
80-
if (topology.shouldCheckForSessionSupport()) {
81-
return topology.selectServer(ReadPreference.primaryPreferred, err => {
82-
if (err) return cb(err);
83-
84-
executeOperation<T, TResult>(topology, operation, cb);
85-
});
86-
}
87-
8880
// The driver sessions spec mandates that we implicitly create sessions for operations
8981
// that are not explicitly provided with a session.
9082
let session: ClientSession | undefined = operation.session;

src/sdam/topology.ts

-11
Original file line numberDiff line numberDiff line change
@@ -630,17 +630,6 @@ export class Topology extends TypedEventEmitter<TopologyEvents> {
630630

631631
// Sessions related methods
632632

633-
/**
634-
* @returns Whether the topology should initiate selection to determine session support
635-
*/
636-
shouldCheckForSessionSupport(): boolean {
637-
if (this.description.type === TopologyType.Single) {
638-
return !this.description.hasKnownServers;
639-
}
640-
641-
return !this.description.hasDataBearingServers;
642-
}
643-
644633
/** Start a logical session */
645634
startSession(options: ClientSessionOptions, clientOptions?: MongoOptions): ClientSession {
646635
const session = new ClientSession(this, this.s.sessionPool, options, clientOptions);

0 commit comments

Comments
 (0)