Skip to content

Commit c875ac8

Browse files
committed
fix: disable causal consistency on implicit sessions
1 parent dad5bee commit c875ac8

File tree

1 file changed

+3
-1
lines changed

1 file changed

+3
-1
lines changed

src/sessions.ts

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -169,8 +169,10 @@ export class ClientSession extends TypedEventEmitter<ClientSessionEvents> {
169169
this[kServerSession] = this.explicit ? this.sessionPool.acquire() : null;
170170
this[kTxnNumberIncrement] = 0;
171171

172+
const canEnableCausalConsistency = this.explicit && options.snapshot !== true;
172173
this.supports = {
173-
causalConsistency: options.snapshot !== true && options.causalConsistency !== false
174+
// if we can enable causal consistency, do so by default
175+
causalConsistency: canEnableCausalConsistency && options.causalConsistency !== false
174176
};
175177

176178
this.clusterTime = options.initialClusterTime;

0 commit comments

Comments
 (0)