Skip to content

fix: ensure manifest timestamp is monotonically increasing#5899

Draft
jackye1995 wants to merge 1 commit intolance-format:mainfrom
jackye1995:increasing-ts
Draft

fix: ensure manifest timestamp is monotonically increasing#5899
jackye1995 wants to merge 1 commit intolance-format:mainfrom
jackye1995:increasing-ts

Conversation

@jackye1995
Copy link
Contributor

No description provided.

@jackye1995 jackye1995 marked this pull request as draft February 5, 2026 22:08
@github-actions github-actions bot added the bug Something isn't working label Feb 5, 2026
@github-actions
Copy link
Contributor

github-actions bot commented Feb 5, 2026

Code Review

P1: Potential overflow in timestamp computation

In temporal.rs:50, the expression prev + MILLIS_TO_NANOS could theoretically overflow if prev is close to u128::MAX. While this is extremely unlikely in practice (timestamps are bounded to ~10^19 nanos currently), adding a saturating add or a checked add with fallback would be more defensive:

match prev_timestamp_nanos {
    Some(prev) => std::cmp::max(current_nanos, prev.saturating_add(MILLIS_TO_NANOS)),
    None => current_nanos,
}

Minor observations (non-blocking):

  1. The documentation states "at least 1 millisecond" but the code actually enforces "exactly 1 millisecond" as the minimum increment. This is fine but worth noting for precision.

  2. Consider adding an integration-style test that actually commits multiple versions in rapid succession and verifies the timestamps are monotonically increasing end-to-end.

Overall, the change is well-structured with good test coverage and clear documentation.

@codecov
Copy link

codecov bot commented Feb 5, 2026

Codecov Report

❌ Patch coverage is 97.43590% with 1 line in your changes missing coverage. Please review.

Files with missing lines Patch % Lines
rust/lance/src/io/commit.rs 66.66% 1 Missing ⚠️

📢 Thoughts on this report? Let us know!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

bug Something isn't working

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant

Comments