pub async fn find_last_transaction_timestamp(
        object_store: &ObjectStore,
        server_id: ServerId,
        db_name: &str,
    ) -> Result<Option<DateTime<Utc>>> {
        let mut res = None;
        for (path, _file_type, _revision_counter, _uuid) in
            list_files(object_store, server_id, db_name).await?
        {
            match load_transaction_proto(object_store, &path).await {
                Ok(proto) => match parse_timestamp(&proto.start_timestamp) {
                    Ok(ts) => {
                        res = Some(res.map_or(ts, |res: DateTime<Utc>| res.max(ts)));
                    }
                    Err(e) => warn!(%e, ?path, "Cannot parse timestamp"),
                },
                Err(e @ Error::Read { .. }) => {
                    // bubble up IO error
                    return Err(e);
                }
                Err(e) => warn!(%e, ?path, "Cannot read transaction"),
            }
        }
        Ok(res)
    }
/// Find last transaction-start-timestamp.
///
/// This method is designed to read and verify as little as possible and should also work on most broken catalogs.
Find last transaction-start-timestamp.
This method is designed to read and verify as little as possible and should also work on most broken catalogs.
Find last transaction - start - timestamp . This method is designed to read and verify as little as possible and should also work on most broken catalogs .
pub async fn find_last_transaction_timestamp(
        object_store: &ObjectStore,
        server_id: ServerId,
        db_name: &str,
    ) -> Result<Option<DateTime<Utc>>> {
        let mut res = None;
        for (path, _file_type, _revision_counter, _uuid) in
            list_files(object_store, server_id, db_name).await?
        {
            match load_transaction_proto(object_store, &path).await {
                Ok(proto) => match parse_timestamp(&proto.start_timestamp) {
                    Ok(ts) => {
                        res = Some(res.map_or(ts, |res: DateTime<Utc>| res.max(ts)));
                    }
                    Err(e) => warn!(%e, ?path, "Cannot parse timestamp"),
                },
                Err(e @ Error::Read { .. }) => {
                    // bubble up IO error
                    return Err(e);
                }
                Err(e) => warn!(%e, ?path, "Cannot read transaction"),
            }
        }
        Ok(res)
    }
pub async fn find_last_transaction_timestamp ( object_store : & ObjectStore , server_id : ServerId , db_name : & str , ) -> Result < Option < DateTime < Utc > > > { let mut res = None ; for ( path , _file_type , _revision_counter , _uuid ) in list_files ( object_store , server_id , db_name ) . await ? { match load_transaction_proto ( object_store , & path ) . await { Ok ( proto ) => match parse_timestamp ( & proto . start_timestamp ) { Ok ( ts ) => { res = Some ( res . map_or ( ts , | res : DateTime < Utc > | res . max ( ts ) ) ) ; } Err ( e ) => warn ! ( e path " " ) , } , Err ( e @ Error :: Read { .. } ) => { // bubble up IO error return Err ( e ) ; } Err ( e ) => warn ! ( e path " " ) , } } Ok ( res ) }
Find last transaction-start-timestamp.
Find last transaction - start - timestamp .
object_store
&ObjectStore
server_id
ServerId
db_name
&str
object_store
&ObjectStore
server_id
ServerId
db_name
&str