File tree Expand file tree Collapse file tree 3 files changed +8
-6
lines changed Expand file tree Collapse file tree 3 files changed +8
-6
lines changed Original file line number Diff line number Diff line change @@ -495,10 +495,7 @@ impl Client {
495
495
}
496
496
// If this is a causally consistent session, set `readConcern.afterClusterTime`.
497
497
// Causal consistency defaults to true, unless snapshot is true.
498
- else if session
499
- . options ( )
500
- . and_then ( |opts| opts. causal_consistency )
501
- . unwrap_or ( true )
498
+ else if session. causal_consistency ( )
502
499
&& matches ! (
503
500
session. transaction. state,
504
501
TransactionState :: None | TransactionState :: Starting
Original file line number Diff line number Diff line change @@ -281,6 +281,12 @@ impl ClientSession {
281
281
self . operation_time
282
282
}
283
283
284
+ pub ( crate ) fn causal_consistency ( & self ) -> bool {
285
+ self . options ( )
286
+ . and_then ( |opts| opts. causal_consistency )
287
+ . unwrap_or ( !self . is_implicit ( ) )
288
+ }
289
+
284
290
/// Mark this session (and the underlying server session) as dirty.
285
291
pub ( crate ) fn mark_dirty ( & mut self ) {
286
292
self . server_session . dirty = true ;
Original file line number Diff line number Diff line change @@ -27,8 +27,7 @@ use crate::{
27
27
#[ cfg_attr( feature = "tokio-runtime" , tokio:: test( flavor = "multi_thread" ) ) ]
28
28
#[ cfg_attr( feature = "async-std-runtime" , async_std:: test) ]
29
29
async fn run_unified ( ) {
30
- // TODO RUST-1414: unskip this file
31
- let mut skipped_files = vec ! [ "implicit-sessions-default-causal-consistency.json" ] ;
30
+ let mut skipped_files = vec ! [ ] ;
32
31
let client = TestClient :: new ( ) . await ;
33
32
if client. is_sharded ( ) && client. server_version_gte ( 7 , 0 ) {
34
33
// TODO RUST-1666: unskip this file
You can’t perform that action at this time.
0 commit comments