Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

UpdateTime in Spanner Writing is Slightly in the Future #1747

Open
renjiezh opened this issue Aug 9, 2024 · 1 comment
Open

UpdateTime in Spanner Writing is Slightly in the Future #1747

renjiezh opened this issue Aug 9, 2024 · 1 comment
Labels
bug Something isn't working

Comments

@renjiezh
Copy link
Contributor

renjiezh commented Aug 9, 2024

Describe the bug
This is found in rpc recordBlobRequests. The UpdateTime in the spanner writing operation is slightly after the database current time, thus this writing fails. The clock of the server is not strictly consistent with the database.

It happened 6 times within 1 minute and recovered.

Steps to reproduce
Run stress test and there is a chance to reproduce.

Component(s) affected
Duchy

Version
v0.5.7-rc4

Environment
QA env

Additional context
Error message example:

Cannot write timestamps in the future 2024-08-09T10:19:56.098900141Z > 2024-08-09T10:19:56.098625Z (current time) because the allow_commit_timestamp column option is set to true for column Computations.UpdateTime, or for a corresponding shared key column in this table's interleaved table hierarchy.

global computation id example: BOxRTMtdgo8

@renjiezh renjiezh added the bug Something isn't working label Aug 9, 2024
@SanjayVas
Copy link
Member

SanjayVas commented Aug 19, 2024

The Spanner error is just an indication of a broader bug: update time is not monotonically increasing. Note that this must not just be monotonically increasing for a single resource, but also across resources of the same type.

The following pattern should be possible:

  1. List all resources of some type updated since time X
  2. Record the latest seen update time from (1) as Y
  3. List all resources of the same type updated since time Y

The result of (3) must not miss any resources, and Y >= X must hold. Therefore, no write with update time <= Y can be committed after a write with update time Y.

I believe this bug affects both Spanner and Postgres Duchy implementations.

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

No branches or pull requests

2 participants