Repository navigation
fix(commit): store the server clock as last-updated-ms - #2220
Conversation
|
No actionable comments were generated in the recent review. WalkthroughTable commits now use one shared server timestamp for ChangesCommit timestamp handling
Estimated code review effort: 4 (Complex) | ~45 minutes Change: Bug fix Possibly related PRs
Suggested reviewers: Merge Risk:
|
Every commit now stores Lakekeeper's clock, read once per commit attempt, as the table's last-updated-ms, as Iceberg Java does since 1.11 (apache/iceberg#14504). Before, the table took the time of the last snapshot the client added. A client whose clock ran ahead could make the table unwritable for other clients, and a snapshot from such a client on a branch or a staged (WAP) snapshot, followed by any metadata-only commit, stored metadata that no client could load. Snapshot times and the snapshot-log entries of added snapshots keep the client's time; a main rollback or publish is logged at the server clock, as in Java. With the iceberg-rust fork's Java-order validation, a writer whose clock is behind Lakekeeper's commits on any branch and as the only writer on main, as with Java's REST catalog. A build that fails because of the times answers 400, as Java's reference server does: TimestampAheadOfServerClock when the stored last-updated-ms, the last snapshot-log entry or a new main snapshot-log entry is more than one minute after the server clock, and TimestampBeforeTableHistory when a new main snapshot-log entry is more than one minute before an earlier one. Every other build error keeps 409. The production checklist asks to keep the clocks of Lakekeeper and its clients synchronized.
e56992b to
ebeaaa4
Compare
✅ PR Title Formatted CorrectlyThe title of this PR match the correct format. Thank you! |
A client with a wrong clock can no longer make a table unwritable or unloadable for other clients. Lakekeeper now records its own clock as the table's
last-updated-mson every commit, as Iceberg Java's REST catalog does since 1.11 (apache/iceberg#14504). Before, the table took the time of the last snapshot the client added. A client whose clock ran ahead could block every other writer until the clock caught up. A snapshot from such a client on a branch, or a staged (WAP) snapshot, followed by any metadata-only commit such as a property change or snapshot expiry, stored metadata that no client could load again. Snapshot times keep the time the client sent; a rollback or publish ofmainis logged at Lakekeeper's clock, as in Java.Writers whose clock is behind Lakekeeper's also commit as with Java's REST catalog: on any branch, and on
mainas long as their snapshots stay in order. Writers whose clock is more than one minute behind can fail to commit tomainshortly after it changed; Iceberg Java clients then fail before they send the commit. Keep the clocks of all Lakekeeper instances and their clients synchronized, for example with NTP. The production checklist now says so.A commit refused because of the times answers 400, as Java's reference server does:
TimestampAheadOfServerClock: a newmainsnapshot dated more than one minute after Lakekeeper's clock. The same applies to every other commit to a table whose stored times are more than one minute after Lakekeeper's clock, for example registered metadata from a host with a fast clock, or a Lakekeeper instance whose clock is behind another's. A commit whose snapshot is stale answers 409 first, as in Java, so the client reloads. Commits succeed again once the clock catches up.TimestampBeforeTableHistory: a newmainsnapshot dated more than one minute before the table's snapshot log.Bumps iceberg-rust to
5117310e4, branchlakekeeper-main-2026-11-03oflakekeeper/iceberg-rust(on top of lakekeeper/iceberg-rust#17):TableMetadataBuilder::set_last_updated_ms.Merge after #2218.
Release notes
Downstream follow-up
Lakekeeper Plus pins
icebergdirectly and must move to the same iceberg-rust rev in the same step. New iceberg-rust public API:TableMetadataBuilder::set_last_updated_ms.Summary by CodeRabbit