pub async fn commit(mut self) -> Result<CheckpointHandle<'c>> {
        let t = std::mem::take(&mut self.transaction)
            .expect("calling .commit on a closed transaction?!");
        let tkey = t.tkey();

        // write to object store
        match t
            .store(
                &self.catalog.object_store,
                self.catalog.server_id,
                &self.catalog.db_name,
            )
            .await
        {
            Ok(()) => {
                // commit to catalog
                let previous_tkey = self.commit_inner(t);
                info!(?tkey, "transaction committed");

                // maybe create a checkpoint
                // IMPORTANT: Create the checkpoint AFTER commiting the transaction to object store and to the in-memory state.
                //            Checkpoints are an optional optimization and are not required to materialize a transaction.
                Ok(CheckpointHandle {
                    catalog: self.catalog,
                    tkey,
                    previous_tkey,
                    permit: self.permit.take().expect("transaction already dropped?!"),
                })
            }
            Err(e) => {
                warn!(?tkey, "failure while writing transaction, aborting");
                t.abort();
                Err(e)
            }
        }
    }
/// Write data to object store and commit transaction to underlying catalog.
///
/// # Checkpointing
/// A [`CheckpointHandle`] will be returned that allows the caller to create a checkpoint. Note that this handle
/// holds a transaction lock, so it's safe to assume that no other transaction is in-progress while the caller
/// prepares the checkpoint.
///
/// # Error Handling
/// When this function returns with an error, it MUST be assumed that the commit has failed and all actions
/// recorded with this handle are NOT preserved.
Write data to object store and commit transaction to underlying catalog.
Write data to object store and commit transaction to underlying catalog .
pub async fn commit(mut self) -> Result<CheckpointHandle<'c>> {
        let t = std::mem::take(&mut self.transaction)
            .expect("calling .commit on a closed transaction?!");
        let tkey = t.tkey();
        // write to object store
        match t
            .store(
                &self.catalog.object_store,
                self.catalog.server_id,
                &self.catalog.db_name,
            )
            .await
        {
            Ok(()) => {
                // commit to catalog
                let previous_tkey = self.commit_inner(t);
                info!(?tkey, "transaction committed");
                // maybe create a checkpoint
                // IMPORTANT: Create the checkpoint AFTER commiting the transaction to object store and to the in-memory state.
                //            Checkpoints are an optional optimization and are not required to materialize a transaction.
                Ok(CheckpointHandle {
                    catalog: self.catalog,
                    tkey,
                    previous_tkey,
                    permit: self.permit.take().expect("transaction already dropped?!"),
                })
            }
            Err(e) => {
                warn!(?tkey, "failure while writing transaction, aborting");
                t.abort();
                Err(e)
            }
        }
    }
pub async fn commit ( mut self ) -> Result < CheckpointHandle < ' c > > { let t = std :: mem :: take ( & mut self . transaction ) . expect ( " " ) ; let tkey = t . tkey ( ) ; // write to object store match t . store ( & self . catalog . object_store , self . catalog . server_id , & self . catalog . db_name , ) . await { Ok ( ( ) ) => { // commit to catalog let previous_tkey = self . commit_inner ( t ) ; info ! ( tkey " " ) ; // maybe create a checkpoint // IMPORTANT: Create the checkpoint AFTER commiting the transaction to object store and to the in-memory state. //            Checkpoints are an optional optimization and are not required to materialize a transaction. Ok ( CheckpointHandle { catalog : self . catalog , tkey , previous_tkey , permit : self . permit . take ( ) . expect ( " " ) , } ) } Err ( e ) => { warn ! ( tkey " " ) ; t . abort ( ) ; Err ( e ) } } }
Write data to object store and commit transaction to underlying catalog.
Write data to object store and commit transaction to underlying catalog .
mut self
mut self
checkpointing
A [`CheckpointHandle`] will be returned that allows the caller to create a checkpoint. Note that this handle
holds a transaction lock, so it's safe to assume that no other transaction is in-progress while the caller
prepares the checkpoint.
A [ ` CheckpointHandle ` ] will be returned that allows the caller to create a checkpoint . Note that this handle holds a transaction lock so it ' s safe to assume that no other transaction is in - progress while the caller prepares the checkpoint .
error handling
When this function returns with an error, it MUST be assumed that the commit has failed and all actions
recorded with this handle are NOT preserved.
When this function returns with an error it MUST be assumed that the commit has failed and all actions recorded with this handle are NOT preserved .