@@ -48,7 +48,7 @@ use datafusion::{datasource::listing::ListingTableUrl, execution::runtime_env::R
4848use itertools:: Itertools ;
4949use relative_path:: RelativePath ;
5050use relative_path:: RelativePathBuf ;
51- use tracing:: error;
51+ use tracing:: { debug , error, instrument , trace } ;
5252
5353use std:: collections:: BTreeMap ;
5454use std:: {
@@ -67,7 +67,7 @@ pub trait ObjectStorageProvider: StorageMetrics + std::fmt::Debug + Send + Sync
6767}
6868
6969#[ async_trait]
70- pub trait ObjectStorage : Send + Sync + ' static {
70+ pub trait ObjectStorage : std :: fmt :: Debug + Send + Sync + ' static {
7171 async fn get_object ( & self , path : & RelativePath ) -> Result < Bytes , ObjectStorageError > ;
7272 // TODO: make the filter function optional as we may want to get all objects
7373 async fn get_objects (
@@ -538,8 +538,10 @@ pub trait ObjectStorage: Send + Sync + 'static {
538538 Ok ( Bytes :: new ( ) )
539539 }
540540
541+ #[ instrument( level = "debug" ) ]
541542 async fn sync ( & self , shutdown_signal : bool ) -> Result < ( ) , ObjectStorageError > {
542543 if !Path :: new ( & CONFIG . staging_dir ( ) ) . exists ( ) {
544+ trace ! ( "Nothing to sync" ) ;
543545 return Ok ( ( ) ) ;
544546 }
545547
@@ -552,6 +554,7 @@ pub trait ObjectStorage: Send + Sync + 'static {
552554 let cache_enabled = STREAM_INFO
553555 . get_cache_enabled ( stream)
554556 . map_err ( |err| ObjectStorageError :: UnhandledError ( Box :: new ( err) ) ) ?;
557+
555558 let time_partition = STREAM_INFO
556559 . get_time_partition ( stream)
557560 . map_err ( |err| ObjectStorageError :: UnhandledError ( Box :: new ( err) ) ) ?;
@@ -568,6 +571,8 @@ pub trait ObjectStorage: Send + Sync + 'static {
568571 )
569572 . map_err ( |err| ObjectStorageError :: UnhandledError ( Box :: new ( err) ) ) ?;
570573
574+ debug ! ( "Arrow files compressed into parquet for stream: {stream}" ) ;
575+
571576 if let Some ( schema) = schema {
572577 let static_schema_flag = STREAM_INFO
573578 . get_static_schema_flag ( stream)
@@ -614,6 +619,8 @@ pub trait ObjectStorage: Send + Sync + 'static {
614619 if let Err ( e) = self . upload_file ( & stream_relative_path, & file) . await {
615620 error ! ( "Failed to upload file {}: {:?}" , filename, e) ;
616621 continue ; // Skip to the next file
622+ } else {
623+ debug ! ( "Parquet file uploaded to s3 for stream: {stream}" ) ;
617624 }
618625
619626 let absolute_path = self
@@ -622,6 +629,7 @@ pub trait ObjectStorage: Send + Sync + 'static {
622629 let store = CONFIG . storage ( ) . get_object_store ( ) ;
623630 let manifest =
624631 catalog:: create_from_parquet_file ( absolute_path. clone ( ) , & file) . unwrap ( ) ;
632+
625633 catalog:: update_snapshot ( store, stream, manifest) . await ?;
626634 if cache_enabled && cache_manager. is_some ( ) {
627635 cache_updates
0 commit comments