emisch0 opened a new issue, #3348:
URL: https://github.com/apache/iceberg-rust/issues/3348
### Is your feature request related to a problem or challenge?
`Transaction::commit` retries retryable errors (such as
`CatalogCommitConflicts` from a REST 409) with exponential backoff built in
`Transaction::build_backoff`:
```rust
ExponentialBuilder::new()
.with_min_delay(Duration::from_millis(props.commit_min_retry_wait_ms()?))
.with_max_delay(Duration::from_millis(props.commit_max_retry_wait_ms()?))
.with_total_delay(Some(Duration::from_millis(props.commit_total_retry_timeout_ms()?)))
.with_max_times(props.commit_num_retries()?)
.with_factor(2.0)
.build()
```
The backoff has no jitter, so every writer waits the same 100 ms, 200 ms,
400 ms, … after a conflict. When several processes append to the same table and
conflict on the same commit, they retry in lockstep. Each round lets one writer
through and sends the rest into the next round together, so contended writers
use up `commit.retry.num-retries` faster than they would with retries spread
out, and the catalog gets bursts of `load_table` + `update_table` requests.
We hit this while building an append-only streaming sink where many
instances write to one table: in a test with 8 concurrent appenders on the
memory catalog, every run had commits that lost to another writer and were
retried.
The Java implementation adds jitter to commit retries
(`Tasks.exponentialBackoff` adds a random 0–10% of the delay), so writers from
different engines also behave differently on the same table today.
### Describe the solution you'd like
Enable jitter in `build_backoff`, e.g. `.with_jitter()` on the
`backon::ExponentialBuilder`. It's a one-line change, and the existing
`commit.retry.*` properties keep their meaning.
If matching Java's bounded jitter (up to 10% on top of the delay) is
preferred over `backon`'s default jitter, that would also work. The main point
is that concurrent writers shouldn't retry at exactly the same moments.
### Willingness to contribute
I can contribute a PR for this, including a test.
--
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
To unsubscribe, e-mail: [email protected]
For queries about this service, please contact Infrastructure at:
[email protected]
---------------------------------------------------------------------
To unsubscribe, e-mail: [email protected]
For additional commands, e-mail: [email protected]