Skip to content

[Util] Introducing RoughTimestamp for second-level granularity timestamps#4572

Open
AhmedSoliman wants to merge 1 commit intomainfrom
pr4572
Open

[Util] Introducing RoughTimestamp for second-level granularity timestamps#4572
AhmedSoliman wants to merge 1 commit intomainfrom
pr4572

Conversation

@AhmedSoliman
Copy link
Copy Markdown
Contributor

@AhmedSoliman AhmedSoliman commented Apr 9, 2026

This timestamp type is intended to be used for invocation scheduling and the RunAt field of vqueues.
While it's internally represented as 4-byte integer, it'll be serialized as u63 (yes, missing one bit) in
EntryKey. This is done to allow future expansion of the granularity if needed.

The granularity is chosen to be second-level to (a) reflect the realistic expecations of invocation scheduling
and (b) to allow invocations in queues to be reordered dynamically withing a single-second window based on
their sequence ordering.

Some helpers in this type are not used (floor_to_minute, smear_to_minute) but are kept for future use if we need to
use this type for coarse jittering or if we need to expand the window-bucketing further.


Stack created with Sapling. Best reviewed with ReviewStack.

@github-actions
Copy link
Copy Markdown

github-actions bot commented Apr 9, 2026

Test Results

  7 files   -  1    7 suites   - 1   5m 3s ⏱️ + 2m 25s
 49 tests  -  4   49 ✅  -  4  0 💤 ±0  0 ❌ ±0 
210 runs   - 23  210 ✅  - 23  0 💤 ±0  0 ❌ ±0 

Results for commit 701c5d7. ± Comparison against base commit 5560b2f.

This pull request removes 4 tests.
dev.restate.sdktesting.tests.UserErrors ‑ failSeveralTimesWithMetadata(URI)
dev.restate.sdktesting.tests.UserErrors ‑ internalCallFailurePropagationWithMetadata(URI)
dev.restate.sdktesting.tests.UserErrors ‑ invokeTerminallyFailingCallWithMetadata(URI)
dev.restate.sdktesting.tests.UserErrors ‑ sideEffectWithTerminalErrorWithMetadata(URI)

♻️ This comment has been updated with latest results.

@AhmedSoliman AhmedSoliman changed the title Roughtimestamp [Util] Introducing RoughTimestamp for second-level granularity timestamps Apr 9, 2026
@AhmedSoliman AhmedSoliman marked this pull request as ready for review April 9, 2026 09:15
…amps

This timestamp type is intended to be used for invocation scheduling and the `RunAt` field of vqueues.
While it's internally represented as 4-byte integer, it'll be serialized as u63 (yes, missing one bit) in
EntryKey. This is done to allow future expansion of the granularity if needed.


The granularity is chosen to be second-level to (a) reflect the realistic expecations of invocation scheduling
and (b) to allow invocations in queues to be reordered dynamically withing a single-second window based on
their sequence ordering.

Some helpers in this type are not used (floor_to_minute, smear_to_minute) but are kept for future use if we need to
use this type for coarse jittering or if we need to expand the window-bucketing further.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant