GoogleCloudPlatform / GoogleCloudPlatform/spring-cloud-gcp
Transaction commit timestamp is never returned from SpannerTemplate
- Dominant language
- Java
- Stars
- 551
- Forks
- 349
- Avg merge
- 1d 13h
- Merged PRs (30d)
- 14
Description
Using the _allow_commit_timestamp_ feature along with com.google.cloud.spring.data.spanner.core.convert.CommitTimestamp leads to a population of stub values to the columns (1970-01-01), where the date is populated as `CommitTimestamp.of(Tijmestamp.class)`.
Internally, SpannerTemplate uses com.google.cloud.spring.data.spanner.core.SpannerTemplate#applyMutations call to deal with transaction stuff and it uses `this.databaseClientProvider.get().write(mutations)` to persist mutations. The database client returns the exact timestamp where the commit has happened in the database.
We can return this date from SpannerTemplate such that consumers know when the transaction commit has happened and can use this date without additional calls to the database.
Contributor guide
Research direction
Start in SpannerTemplate#applyMutations and trace the databaseClientProvider.get().write(mutations) call. Check how transaction results are exposed and how CommitTimestamp values are populated. Done means the commit timestamp returned by Spanner is available to consumers without an additional database call, with coverage for the allow_commit_timestamp path.
Written by the indexing model from the issue text.
Assessment
- Tech stack
- gcp, java, spring
- Domain
- backend, databases
- Issue type
- Bug
- Difficulty
- 4/5
- Estimated time
- 3-5 days
- Activity status
- Stale
- Clarity
- Mostly clear
- Newbie friendliness
- 35/100