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 {
495495 }
496496 // If this is a causally consistent session, set `readConcern.afterClusterTime`.
497497 // 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 ( )
502499 && matches ! (
503500 session. transaction. state,
504501 TransactionState :: None | TransactionState :: Starting
Original file line number Diff line number Diff line change @@ -281,6 +281,12 @@ impl ClientSession {
281281 self . operation_time
282282 }
283283
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+
284290 /// Mark this session (and the underlying server session) as dirty.
285291 pub ( crate ) fn mark_dirty ( & mut self ) {
286292 self . server_session . dirty = true ;
Original file line number Diff line number Diff line change @@ -27,8 +27,7 @@ use crate::{
2727#[ cfg_attr( feature = "tokio-runtime" , tokio:: test( flavor = "multi_thread" ) ) ]
2828#[ cfg_attr( feature = "async-std-runtime" , async_std:: test) ]
2929async 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 ! [ ] ;
3231 let client = TestClient :: new ( ) . await ;
3332 if client. is_sharded ( ) && client. server_version_gte ( 7 , 0 ) {
3433 // TODO RUST-1666: unskip this file
You can’t perform that action at this time.
0 commit comments