You are viewing a plain text version of this content. The canonical link for it is here.
Posted to issues@iceberg.apache.org by "Kurtiscwright (via GitHub)" <gi...@apache.org> on 2026/05/01 23:12:57 UTC
[PR] fix(catalog/memory): relax strict ms inequality in test_update_table [iceberg-rust]
Kurtiscwright opened a new pull request, #2395:
URL: https://github.com/apache/iceberg-rust/pull/2395
While running make unit-test for verifying the RC the update_table test in /src/memory/catalog.rs was failing because it checks for the table and updated_table to have different updated timestamps down to the ms, but on a fast enough machine the test can update the updated_table in the same ms as the table causing the test to incorrectly fail.
## Which issue does this PR close?
<!--
We generally require a GitHub issue to be filed for all bug fixes and enhancements and this helps us generate change logs for our releases. You can link an issue to this PR using the GitHub syntax. For example `Closes #123` indicates that this PR will close issue #123.
-->
- Closes #2393 .
## What changes are included in this PR?
<!--
Provide a summary of the modifications in this PR. List the main changes such as new features, bug fixes, refactoring, or any other updates.
-->
## Are these changes tested?
<!--
Specify what test covers (unit test, integration test, etc.).
If tests are not included in your PR, please explain why (for example, are they covered by existing tests)?
-->
--
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: issues-unsubscribe@iceberg.apache.org
For queries about this service, please contact Infrastructure at:
users@infra.apache.org
---------------------------------------------------------------------
To unsubscribe, e-mail: issues-unsubscribe@iceberg.apache.org
For additional commands, e-mail: issues-help@iceberg.apache.org
Re: [PR] fix(catalog/memory): relax strict ms inequality in test_update_table [iceberg-rust]
Posted by "Kurtiscwright (via GitHub)" <gi...@apache.org>.
Kurtiscwright commented on PR #2395:
URL: https://github.com/apache/iceberg-rust/pull/2395#issuecomment-4389848936
@sungwy @blackmwk @toutane thank you all for the additional reviews, discussion and feedback!
--
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: issues-unsubscribe@iceberg.apache.org
For queries about this service, please contact Infrastructure at:
users@infra.apache.org
---------------------------------------------------------------------
To unsubscribe, e-mail: issues-unsubscribe@iceberg.apache.org
For additional commands, e-mail: issues-help@iceberg.apache.org
Re: [PR] fix(catalog/memory): relax strict ms inequality in test_update_table [iceberg-rust]
Posted by "CTTY (via GitHub)" <gi...@apache.org>.
CTTY merged PR #2395:
URL: https://github.com/apache/iceberg-rust/pull/2395
--
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: issues-unsubscribe@iceberg.apache.org
For queries about this service, please contact Infrastructure at:
users@infra.apache.org
---------------------------------------------------------------------
To unsubscribe, e-mail: issues-unsubscribe@iceberg.apache.org
For additional commands, e-mail: issues-help@iceberg.apache.org
Re: [PR] fix(catalog/memory): relax strict ms inequality in test_update_table [iceberg-rust]
Posted by "Kurtiscwright (via GitHub)" <gi...@apache.org>.
Kurtiscwright commented on PR #2395:
URL: https://github.com/apache/iceberg-rust/pull/2395#issuecomment-4380531505
@CTTY & @toutane thank you both for commenting. I will send out a follow up commit later today. I agree philosophically with the proposal from @toutane, but I think both solutions leave an implementation detail that could be missed by future use cases. I don't like adding "latency" to something that is supposed to be fine grained. I want to understand why no timestamp is not set explicitly then propose a solution from there.
Otherwise I think `last_updated_ms` should be renamed to something that expresses this built "latency" mechanism.
--
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: issues-unsubscribe@iceberg.apache.org
For queries about this service, please contact Infrastructure at:
users@infra.apache.org
---------------------------------------------------------------------
To unsubscribe, e-mail: issues-unsubscribe@iceberg.apache.org
For additional commands, e-mail: issues-help@iceberg.apache.org
Re: [PR] fix(catalog/memory): relax strict ms inequality in test_update_table [iceberg-rust]
Posted by "Kurtiscwright (via GitHub)" <gi...@apache.org>.
Kurtiscwright commented on PR #2395:
URL: https://github.com/apache/iceberg-rust/pull/2395#issuecomment-4389839669
> > @CTTY @toutane I traced the full call and checked the spec + Java implementation, I'm feel strongly that we should keep the current <= approach.
> > The spec defines last-updated-ms as a wall-clock observation, not a logical clock.
> > From the Table Metadata Fields (https://iceberg.apache.org/spec/#table-metadata-fields) section:
> > │ last-updated-ms Timestamp in milliseconds from the unix epoch when the table was last updated. Each table metadata file should update this field just before writing.
> > The spec makes no monotonicity guarantee. Two updates within the same millisecond producing equal values is spec-compliant behavior.
> > The Java implementation has the same behavior.
> > In TableMetadata.Builder.build() (https://github.com/apache/iceberg/blob/main/core/src/main/java/org/apache/iceberg/TableMetadata.java), the Java code does:
> > ```java
> > if (lastUpdatedMillis == null) {
> > this.lastUpdatedMillis = System.currentTimeMillis();
> > }
> > ```
> >
> >
> >
> >
> >
> >
> >
> >
> >
> >
> >
> > No +1, no `max()`, no monotonicity enforcement. It is identical to what the Rust implementation does with `Utc::now().timestamp_millis()`.
> > The Java project explicitly chose tolerance over strict ordering.
> > Issue #1109 ([apache/iceberg#1109](https://github.com/apache/iceberg/issues/1109)) documents a real-world case where lastUpdatedMillis ended up lower than a previous metadata-log entry due to multi-machine clock skew. The fix (PR #1110 ([apache/iceberg#1110](https://github.com/apache/iceberg/pull/1110))) added a 1-minute tolerance with the comment:
> > ```java
> > // commits can happen concurrently from different machines.
> > // A tolerance helps us avoid failure for small clock skew
> > lastUpdatedMillis - last.timestampMillis() >= -ONE_MINUTE
> > ```
> >
> >
> >
> >
> >
> >
> >
> >
> >
> >
> >
> > Equal timestamps pass this validation trivially (difference = 0, which is >= -60000).
> > last-updated-ms is not used for any operational decision.
> > No TableRequirement variant checks last-updated-ms. Conflict detection uses UUID, schema ID, snapshot ref, spec ID, sort order ID, and field IDs. Metadata version ordering is determined by the filename (v1.metadata.json → v2.metadata.json), not timestamps.
> > Why not sleep(2ms) or max(now, previous + 1)?
> >
> > * sleep adds artificial latency to a field that the spec defines as informational. It also doesn't solve the problem for real multi-machine deployments where clock skew can exceed any fixed sleep.
> > * max(now, previous + 1) silently mutates the timestamp away from wall-clock truth. Future callers of the builder would get a value that doesn't represent when the update actually happened, with no indication it was adjusted. The field's name and spec definition say "when was this last updated" — making it lie
> > about that to satisfy a test assertion inverts the relationship between spec and test.
> >
> > The original < assertion was over-specifying an invariant the system doesn't depend on. The <= correctly reflects the spec's semantics: the timestamp records when the update happened, and two updates in the same millisecond are valid.
>
> Then how about removing the asseration? Since it's not used for any purpose, in theory anything can happen due to clock skew.
While its correct that clock skew in distributed systems and spread across hosts can cause any combination of results. I think that's the wrong take away. This test is validating that at worst case on the same host an update request lands in the same ms as another update or create call for that same table. This gives us some assurance that we didn't create a scenario where an update can happen before another update or before a table is created when using a single node environment.
The Java example gives us historical background on the `last-updated-ms` isn't being used for ordering validation but is an informative field so long as the clock skew only causes a new update to land within 1 minute less than the previous update. I think we keep the test as its not wrong and after my research yesterday I think the `<=` assertion makes the test stronger.
--
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: issues-unsubscribe@iceberg.apache.org
For queries about this service, please contact Infrastructure at:
users@infra.apache.org
---------------------------------------------------------------------
To unsubscribe, e-mail: issues-unsubscribe@iceberg.apache.org
For additional commands, e-mail: issues-help@iceberg.apache.org
Re: [PR] fix(catalog/memory): relax strict ms inequality in test_update_table [iceberg-rust]
Posted by "blackmwk (via GitHub)" <gi...@apache.org>.
blackmwk commented on code in PR #2395:
URL: https://github.com/apache/iceberg-rust/pull/2395#discussion_r3193296123
##########
crates/iceberg/src/catalog/memory/catalog.rs:
##########
Review Comment:
+1
--
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: issues-unsubscribe@iceberg.apache.org
For queries about this service, please contact Infrastructure at:
users@infra.apache.org
---------------------------------------------------------------------
To unsubscribe, e-mail: issues-unsubscribe@iceberg.apache.org
For additional commands, e-mail: issues-help@iceberg.apache.org
Re: [PR] fix(catalog/memory): relax strict ms inequality in test_update_table [iceberg-rust]
Posted by "toutane (via GitHub)" <gi...@apache.org>.
toutane commented on PR #2395:
URL: https://github.com/apache/iceberg-rust/pull/2395#issuecomment-4386352710
Hey @Kurtiscwright, thanks for the explanation, if this is how Java does it then I fine with it.
--
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: issues-unsubscribe@iceberg.apache.org
For queries about this service, please contact Infrastructure at:
users@infra.apache.org
---------------------------------------------------------------------
To unsubscribe, e-mail: issues-unsubscribe@iceberg.apache.org
For additional commands, e-mail: issues-help@iceberg.apache.org
Re: [PR] fix(catalog/memory): relax strict ms inequality in test_update_table [iceberg-rust]
Posted by "CTTY (via GitHub)" <gi...@apache.org>.
CTTY commented on PR #2395:
URL: https://github.com/apache/iceberg-rust/pull/2395#issuecomment-4392912969
After a second thought, I think we should just remove the assertion.
Due to clock skew, it doesn't make sense to use `last_updated_ms` to confirm whether the table has been updated. A newer `last_updated_ms` can technically be smaller than the previous ts.
The existing test uses `metadata_location` and `snapshot_log` to confirm the table is updated, and it is already sufficient:
```
assert_ne!(table.metadata_location(), updated_table.metadata_location());
assert!(
table.metadata().metadata_log().len() < updated_table.metadata().metadata_log().len()
);
```
--
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: issues-unsubscribe@iceberg.apache.org
For queries about this service, please contact Infrastructure at:
users@infra.apache.org
---------------------------------------------------------------------
To unsubscribe, e-mail: issues-unsubscribe@iceberg.apache.org
For additional commands, e-mail: issues-help@iceberg.apache.org
Re: [PR] fix(catalog/memory): relax strict ms inequality in test_update_table [iceberg-rust]
Posted by "toutane (via GitHub)" <gi...@apache.org>.
toutane commented on PR #2395:
URL: https://github.com/apache/iceberg-rust/pull/2395#issuecomment-4378130525
Hey, one thing worth considering imho, he root issue is in `TableMetadataBuilder::build()`, which uses `Utc::now()` when no timestamp is set explicitly. An alternative that fixes it at the source rather than relaxing the assertion:
```rust
self.metadata.last_updated_ms = self.last_updated_ms.unwrap_or_else(|| {
chrono::Utc::now()
.timestamp_millis()
.max(self.metadata.last_updated_ms + 1)
});
```
--
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: issues-unsubscribe@iceberg.apache.org
For queries about this service, please contact Infrastructure at:
users@infra.apache.org
---------------------------------------------------------------------
To unsubscribe, e-mail: issues-unsubscribe@iceberg.apache.org
For additional commands, e-mail: issues-help@iceberg.apache.org
Re: [PR] fix(catalog/memory): relax strict ms inequality in test_update_table [iceberg-rust]
Posted by "kevinjqliu (via GitHub)" <gi...@apache.org>.
kevinjqliu commented on code in PR #2395:
URL: https://github.com/apache/iceberg-rust/pull/2395#discussion_r3204060972
##########
crates/iceberg/src/catalog/memory/catalog.rs:
##########
@@ -1888,7 +1888,7 @@ pub(crate) mod tests {
assert_eq!(table.identifier(), updated_table.identifier());
assert_eq!(table.metadata().uuid(), updated_table.metadata().uuid());
- assert!(table.metadata().last_updated_ms() < updated_table.metadata().last_updated_ms());
+ assert!(table.metadata().last_updated_ms() <= updated_table.metadata().last_updated_ms());
Review Comment:
based on what we discussed on the community sync today, my preference would be to pick either
- remove this assertion, because it gives a false sense of invariance regarding `last_updated_ms`
- keep `<=` but add a comment about allowing 1 min clock skew
i dont have a hard preference
--
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: issues-unsubscribe@iceberg.apache.org
For queries about this service, please contact Infrastructure at:
users@infra.apache.org
---------------------------------------------------------------------
To unsubscribe, e-mail: issues-unsubscribe@iceberg.apache.org
For additional commands, e-mail: issues-help@iceberg.apache.org
Re: [PR] fix(catalog/memory): relax strict ms inequality in test_update_table [iceberg-rust]
Posted by "kevinjqliu (via GitHub)" <gi...@apache.org>.
kevinjqliu commented on PR #2395:
URL: https://github.com/apache/iceberg-rust/pull/2395#issuecomment-4400366312
i just saw shawn/renjie's comments, they're both leaning towards removing the assertion. Can we do that to move forward?
--
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: issues-unsubscribe@iceberg.apache.org
For queries about this service, please contact Infrastructure at:
users@infra.apache.org
---------------------------------------------------------------------
To unsubscribe, e-mail: issues-unsubscribe@iceberg.apache.org
For additional commands, e-mail: issues-help@iceberg.apache.org
Re: [PR] fix(catalog/memory): relax strict ms inequality in test_update_table [iceberg-rust]
Posted by "toutane (via GitHub)" <gi...@apache.org>.
toutane commented on PR #2395:
URL: https://github.com/apache/iceberg-rust/pull/2395#issuecomment-4378092220
Thanks for catching this! The fix works, but I'd suggest considering an alternative that addresses the root cause rather than relaxing the assertion.
**The underlying issue** is in `TableMetadataBuilder::build()` (`crates/iceberg/src/spec/table_metadata_builder.rs`):
```rust
self.metadata.last_updated_ms = self
.last_updated_ms
.unwrap_or_else(|| chrono::Utc::now().timestamp_millis());
```
When no explicit timestamp is provided, `build()` calls `Utc::now()`. If a table creation and an update both call `build()` within the same millisecond, they get the same timestamp — hence the flaky test.
**Alternative fix** — guarantee strict monotonic increase in the builder itself:
```rust
self.metadata.last_updated_ms = self.last_updated_ms.unwrap_or_else(|| {
// Guarantee strict monotonic increase when building from existing metadata.
chrono::Utc::now()
.timestamp_millis()
.max(self.metadata.last_updated_ms + 1)
});
```
At the point of this assignment, `self.metadata.last_updated_ms` still holds the *previous* metadata's timestamp (set by `new_from_metadata`). Taking `max(now, prev + 1)` ensures the new timestamp is always strictly greater, without ever going backwards if the clock happens to be the same.
**Why this is preferable:**
- The original `<` assertion correctly captures the invariant that every commit must advance `last_updated_ms`. Relaxing it to `<=` hides the fact that two successive updates could share the same timestamp, which could silently break any downstream logic that relies on ordering (snapshot logs, metadata logs, conflict detection, etc.).
- The builder fix benefits all callers — not just this one test — and makes the invariant hold by construction.
For a fresh table creation (`new` / `from_table_creation`), the initial `last_updated_ms` is `0`, so `max(now, 1) = now` — no behavior change there.
Happy to open a follow-up PR if useful!
--
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: issues-unsubscribe@iceberg.apache.org
For queries about this service, please contact Infrastructure at:
users@infra.apache.org
---------------------------------------------------------------------
To unsubscribe, e-mail: issues-unsubscribe@iceberg.apache.org
For additional commands, e-mail: issues-help@iceberg.apache.org
Re: [PR] fix(catalog/memory): relax strict ms inequality in test_update_table [iceberg-rust]
Posted by "blackmwk (via GitHub)" <gi...@apache.org>.
blackmwk commented on PR #2395:
URL: https://github.com/apache/iceberg-rust/pull/2395#issuecomment-4395805020
> The Java example gives us historical background on the last-updated-ms isn't being used for ordering validation but is an informative field so long as the clock skew only causes a new update to land within 1 minute less than the previous update. I think we keep the test as its not wrong and after my research yesterday I think the <= assertion makes the test stronger.
I agree with following java's behavior to make the `last-updated-ms` field more informative. But this is what this pr is doing. This pr is fixing a check in ut, not at runtime. What actually should be done is to add check at runtime, but maybe we should open another pr for it.
For the sake of this pr, we should simply remove the check.
--
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: issues-unsubscribe@iceberg.apache.org
For queries about this service, please contact Infrastructure at:
users@infra.apache.org
---------------------------------------------------------------------
To unsubscribe, e-mail: issues-unsubscribe@iceberg.apache.org
For additional commands, e-mail: issues-help@iceberg.apache.org
Re: [PR] fix(catalog/memory): relax strict ms inequality in test_update_table [iceberg-rust]
Posted by "blackmwk (via GitHub)" <gi...@apache.org>.
blackmwk commented on PR #2395:
URL: https://github.com/apache/iceberg-rust/pull/2395#issuecomment-4386864350
> @CTTY @toutane I traced the full call and checked the spec + Java implementation, I'm feel strongly that we should keep the current <= approach.
>
> The spec defines last-updated-ms as a wall-clock observation, not a logical clock.
>
> From the Table Metadata Fields (https://iceberg.apache.org/spec/#table-metadata-fields) section:
>
> │ last-updated-ms Timestamp in milliseconds from the unix epoch when the table was last updated. Each table metadata file should update this field just before writing.
>
> The spec makes no monotonicity guarantee. Two updates within the same millisecond producing equal values is spec-compliant behavior.
>
> The Java implementation has the same behavior.
>
> In TableMetadata.Builder.build() (https://github.com/apache/iceberg/blob/main/core/src/main/java/org/apache/iceberg/TableMetadata.java), the Java code does:
>
> ```java
> if (lastUpdatedMillis == null) {
> this.lastUpdatedMillis = System.currentTimeMillis();
> }
> ```
>
> No +1, no `max()`, no monotonicity enforcement. It is identical to what the Rust implementation does with `Utc::now().timestamp_millis()`.
>
> The Java project explicitly chose tolerance over strict ordering.
>
> Issue #1109 ([apache/iceberg#1109](https://github.com/apache/iceberg/issues/1109)) documents a real-world case where lastUpdatedMillis ended up lower than a previous metadata-log entry due to multi-machine clock skew. The fix (PR #1110 ([apache/iceberg#1110](https://github.com/apache/iceberg/pull/1110))) added a 1-minute tolerance with the comment:
>
> ```java
> // commits can happen concurrently from different machines.
> // A tolerance helps us avoid failure for small clock skew
> lastUpdatedMillis - last.timestampMillis() >= -ONE_MINUTE
> ```
>
> Equal timestamps pass this validation trivially (difference = 0, which is >= -60000).
>
> last-updated-ms is not used for any operational decision.
>
> No TableRequirement variant checks last-updated-ms. Conflict detection uses UUID, schema ID, snapshot ref, spec ID, sort order ID, and field IDs. Metadata version ordering is determined by the filename (v1.metadata.json → v2.metadata.json), not timestamps.
>
> Why not sleep(2ms) or max(now, previous + 1)?
>
> * sleep adds artificial latency to a field that the spec defines as informational. It also doesn't solve the problem for real multi-machine deployments where clock skew can exceed any fixed sleep.
> * max(now, previous + 1) silently mutates the timestamp away from wall-clock truth. Future callers of the builder would get a value that doesn't represent when the update actually happened, with no indication it was adjusted. The field's name and spec definition say "when was this last updated" — making it lie
> about that to satisfy a test assertion inverts the relationship between spec and test.
>
> The original < assertion was over-specifying an invariant the system doesn't depend on. The <= correctly reflects the spec's semantics: the timestamp records when the update happened, and two updates in the same millisecond are valid.
Then how about removing the asseration? Since it's not used for any purpose, in theory anything can happen due to clock skew.
--
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: issues-unsubscribe@iceberg.apache.org
For queries about this service, please contact Infrastructure at:
users@infra.apache.org
---------------------------------------------------------------------
To unsubscribe, e-mail: issues-unsubscribe@iceberg.apache.org
For additional commands, e-mail: issues-help@iceberg.apache.org
Re: [PR] fix(catalog/memory): relax strict ms inequality in test_update_table [iceberg-rust]
Posted by "CTTY (via GitHub)" <gi...@apache.org>.
CTTY commented on code in PR #2395:
URL: https://github.com/apache/iceberg-rust/pull/2395#discussion_r3184783533
##########
crates/iceberg/src/catalog/memory/catalog.rs:
##########
Review Comment:
how about just sleep 2 ms here?
Allowing last_updated_ms to be unchanged does not make sense to me
--
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: issues-unsubscribe@iceberg.apache.org
For queries about this service, please contact Infrastructure at:
users@infra.apache.org
---------------------------------------------------------------------
To unsubscribe, e-mail: issues-unsubscribe@iceberg.apache.org
For additional commands, e-mail: issues-help@iceberg.apache.org
Re: [PR] fix(catalog/memory): relax strict ms inequality in test_update_table [iceberg-rust]
Posted by "Kurtiscwright (via GitHub)" <gi...@apache.org>.
Kurtiscwright commented on PR #2395:
URL: https://github.com/apache/iceberg-rust/pull/2395#issuecomment-4385263741
@CTTY @toutane I traced the full call and checked the spec + Java implementation, I'm feel strongly that we should keep the current <= approach.
The spec defines last-updated-ms as a wall-clock observation, not a logical clock.
From the Table Metadata Fields (https://iceberg.apache.org/spec/#table-metadata-fields) section:
│ last-updated-ms Timestamp in milliseconds from the unix epoch when the table was last updated. Each table metadata file should update this field just before writing.
The spec makes no monotonicity guarantee. Two updates within the same millisecond producing equal values is spec-compliant behavior.
The Java implementation has the same behavior.
In TableMetadata.Builder.build() (https://github.com/apache/iceberg/blob/main/core/src/main/java/org/apache/iceberg/TableMetadata.java), the Java code does:
```java
if (lastUpdatedMillis == null) {
this.lastUpdatedMillis = System.currentTimeMillis();
}
```
No +1, no `max()`, no monotonicity enforcement. It is identical to what the Rust implementation does with `Utc::now().timestamp_millis()`.
The Java project explicitly chose tolerance over strict ordering.
Issue #1109 (https://github.com/apache/iceberg/issues/1109) documents a real-world case where lastUpdatedMillis ended up lower than a previous metadata-log entry due to multi-machine clock skew. The fix (PR #1110 (https://github.com/apache/iceberg/pull/1110)) added a 1-minute tolerance with the comment:
```java
// commits can happen concurrently from different machines.
// A tolerance helps us avoid failure for small clock skew
lastUpdatedMillis - last.timestampMillis() >= -ONE_MINUTE
```
Equal timestamps pass this validation trivially (difference = 0, which is >= -60000).
last-updated-ms is not used for any operational decision.
No TableRequirement variant checks last-updated-ms. Conflict detection uses UUID, schema ID, snapshot ref, spec ID, sort order ID, and field IDs. Metadata version ordering is determined by the filename (v1.metadata.json → v2.metadata.json), not timestamps.
Why not sleep(2ms) or max(now, previous + 1)?
- sleep adds artificial latency to a field that the spec defines as informational. It also doesn't solve the problem for real multi-machine deployments where clock skew can exceed any fixed sleep.
- max(now, previous + 1) silently mutates the timestamp away from wall-clock truth. Future callers of the builder would get a value that doesn't represent when the update actually happened, with no indication it was adjusted. The field's name and spec definition say "when was this last updated" — making it lie
about that to satisfy a test assertion inverts the relationship between spec and test.
The original < assertion was over-specifying an invariant the system doesn't depend on. The <= correctly reflects the spec's semantics: the timestamp records when the update happened, and two updates in the same millisecond are valid.
--
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: issues-unsubscribe@iceberg.apache.org
For queries about this service, please contact Infrastructure at:
users@infra.apache.org
---------------------------------------------------------------------
To unsubscribe, e-mail: issues-unsubscribe@iceberg.apache.org
For additional commands, e-mail: issues-help@iceberg.apache.org
Re: [PR] fix(catalog/memory): relax strict ms inequality in test_update_table [iceberg-rust]
Posted by "Kurtiscwright (via GitHub)" <gi...@apache.org>.
Kurtiscwright commented on PR #2395:
URL: https://github.com/apache/iceberg-rust/pull/2395#issuecomment-4401122842
@CTTY @kevinjqliu @liurenjie1024 After discussion this morning and Kevin's comment, I've updated the commit to remove the assertion. Please let me know if there are any other concerns.
--
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: issues-unsubscribe@iceberg.apache.org
For queries about this service, please contact Infrastructure at:
users@infra.apache.org
---------------------------------------------------------------------
To unsubscribe, e-mail: issues-unsubscribe@iceberg.apache.org
For additional commands, e-mail: issues-help@iceberg.apache.org