Skip to content

Commit c5f859d

Browse files
committed
remove pre-4.2 logic in sessions
1 parent c617294 commit c5f859d

File tree

1 file changed

+0
-14
lines changed

1 file changed

+0
-14
lines changed

src/sessions.ts

Lines changed: 0 additions & 14 deletions
Original file line numberDiff line numberDiff line change
@@ -42,7 +42,6 @@ import {
4242
commandSupportsReadConcern,
4343
isPromiseLike,
4444
List,
45-
maxWireVersion,
4645
MongoDBNamespace,
4746
noop,
4847
now,
@@ -51,8 +50,6 @@ import {
5150
} from './utils';
5251
import { WriteConcern, type WriteConcernOptions, type WriteConcernSettings } from './write_concern';
5352

54-
const minWireVersionForShardedTransactions = 8;
55-
5653
/** @public */
5754
export interface ClientSessionOptions {
5855
/** Whether causal consistency should be enabled on this session */
@@ -405,17 +402,6 @@ export class ClientSession
405402
this.unpin();
406403
}
407404

408-
const topologyMaxWireVersion = maxWireVersion(this.client.topology);
409-
if (
410-
isSharded(this.client.topology) &&
411-
topologyMaxWireVersion != null &&
412-
topologyMaxWireVersion < minWireVersionForShardedTransactions
413-
) {
414-
throw new MongoCompatibilityError(
415-
'Transactions are not supported on sharded clusters in MongoDB < 4.2.'
416-
);
417-
}
418-
419405
this.commitAttempted = false;
420406
// increment txnNumber
421407
this.incrementTransactionNumber();

0 commit comments

Comments
 (0)