Skip to content

Prefer a timestamp from the database #1961

@data-sync-user

Description

@data-sync-user

We often defer to the database for time keeping such as when filtering against expiry via CURRENT_TIMESTAMP (diesel::dsl::now).

The Spanner impl also does this, but it also goes one step further and additionally gets itsSyncTimestamp value from the database. It already needs to query the db in lock_for_write before making any writes, so it might as well ask for the timestamp there anyway.

A side effect of this change is it also forces the SyncTimestamp to be None for read methods, which adds an extra check layer to them as they should never require it, not making any writes.

┆Issue is synchronized with this Jira Task

Metadata

Metadata

Assignees

Labels

No labels
No labels

Type

No type

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions