@@ -41,11 +41,14 @@ where
41
41
42
42
/// Takes a snapshot and commits the read transaction.
43
43
pub fn begin ( self ) -> Result < Snapshot > {
44
- let file_clones = self . clone_files ( ) . context ( "cloning files" ) ?;
45
- self . owned_tx
46
- . end_tx ( |tx| tx. commit ( ) )
47
- . context ( "committing transaction" ) ?
48
- . complete ( ) ;
44
+ log_time ! (
45
+ { num_files = self . reads. len( ) } ,
46
+ "cloning files" ;
47
+ let file_clones = self . clone_files( ) . context( "cloning files" ) ?
48
+ ) ;
49
+ let commit = || self . owned_tx . end_tx ( |tx| tx. commit ( ) ) ;
50
+ let post_work = log_time ! ( "reader commit" , commit( ) ) ;
51
+ post_work. context ( "committing transaction" ) ?. complete ( ) ;
49
52
Ok ( Snapshot { file_clones } )
50
53
}
51
54
@@ -99,9 +102,14 @@ where
99
102
if self . owned_tx . as_handle ( ) . dir_supports_file_cloning ( ) {
100
103
match self . clone_file ( file_id, tempdir, cache, src_dir) {
101
104
Err ( err) if err. root_cause_is_unsupported_filesystem ( ) => ( ) ,
102
- default => return default,
105
+ Err ( err) => return Err ( err) ,
106
+ default @ Ok ( _) => {
107
+ info ! ( %file_id, tempdir = %tempdir. as_ref( ) . unwrap( ) . path( ) . display( ) , "cloned file" ) ;
108
+ return default;
109
+ }
103
110
}
104
111
}
112
+ warn ! ( %file_id, ?read_extents, "falling back to segment locking to read" ) ;
105
113
self . get_file_for_read_by_segment_locking ( file_id, read_extents)
106
114
}
107
115
0 commit comments