Skip to content
Closed
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
1 change: 1 addition & 0 deletions Cargo.lock

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

1 change: 1 addition & 0 deletions crates/iceberg/Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -85,6 +85,7 @@ serde_repr = { workspace = true }
serde_with = { workspace = true }
strum = { workspace = true, features = ["derive"] }
tokio = { workspace = true, optional = false, features = ["sync"] }
log = { workspace = true }
typed-builder = { workspace = true }
typetag = { workspace = true }
url = { workspace = true }
Expand Down
18 changes: 18 additions & 0 deletions crates/iceberg/src/transaction/mod.rs
Original file line number Diff line number Diff line change
Expand Up @@ -58,6 +58,7 @@ mod snapshot;
mod sort_order;
mod update_location;
mod update_properties;
mod update_schema;
mod update_statistics;
mod upgrade_format_version;

Expand All @@ -74,6 +75,7 @@ use crate::transaction::append::FastAppendAction;
use crate::transaction::sort_order::ReplaceSortOrderAction;
use crate::transaction::update_location::UpdateLocationAction;
use crate::transaction::update_properties::UpdatePropertiesAction;
use crate::transaction::update_schema::UpdateSchemaAction;
use crate::transaction::update_statistics::UpdateStatisticsAction;
use crate::transaction::upgrade_format_version::UpgradeFormatVersionAction;
use crate::{Catalog, TableCommit, TableRequirement, TableUpdate};
Expand Down Expand Up @@ -136,6 +138,11 @@ impl Transaction {
UpdatePropertiesAction::new()
}

/// Creates an update schema action.
pub fn update_schema(&self) -> UpdateSchemaAction {
UpdateSchemaAction::new()
}

/// Creates a fast append action.
pub fn fast_append(&self) -> FastAppendAction {
FastAppendAction::new()
Expand Down Expand Up @@ -168,6 +175,9 @@ impl Transaction {
let backoff = Self::build_backoff(table_props)?;
let tx = self;

let table_ident = tx.table.identifier().clone();

log::info!("Starting transaction commit for {}", table_ident.clone());
(|mut tx: Transaction| async {
let result = tx.do_commit(catalog).await;
(tx, result)
Expand All @@ -176,6 +186,14 @@ impl Transaction {
.sleep(tokio::time::sleep)
.context(tx)
.when(|e| e.retryable())
.notify(move |err, dur| {
log::warn!(
"Transaction commit for {} failed with retryable error, retrying in {:?}: {}",
table_ident,
dur,
err
);
})
.await
.1
}
Expand Down
Loading
Loading