Dark Mode

Skip to content

Navigation Menu

Sign in
Appearance settings

Search code, repositories, users, issues, pull requests...

Provide feedback

We read every piece of feedback, and take your input very seriously.

Saved searches

Use saved searches to filter your results more quickly

Sign up
Appearance settings

Support atomic writes in the docstore#3500

Merged
jba merged 3 commits intogoogle:masterfrom
sandeepvinayak:spal-transactions
Jan 23, 2025
Merged

Support atomic writes in the docstore#3500
jba merged 3 commits intogoogle:masterfrom
sandeepvinayak:spal-transactions

Conversation

Copy link
Contributor

sandeepvinayak commented Oct 11, 2024 *
edited
Loading

docstore/all

Details in the issue : #3501

Please reference any Issue related to this Pull Request. Example: Fixes #1.

See
here
for tips on good Pull Request description.

Copy link

google-cla bot commented Oct 11, 2024

Thanks for your pull request! It looks like this may be your first contribution to a Google open source project. Before we can look at your pull request, you'll need to sign a Contributor License Agreement (CLA).

View this failed invocation of the CLA check for more information.

For the most up to date status, view the checks section at the bottom of the pull request.

Copy link
Contributor Author

sandeepvinayak commented Oct 11, 2024

@eliben @vangent We are trying to add the transactions support/atomic writes in the docstore and this is the high level idea of how can we support that in go-cloud. https://docs.google.com/document/d/1UVj1kmwDfrs5qm8r7X1p4fAFmsdPEeBHcvWJ8zWF1dY/edit?tab=t.0

The PR is just at a high level to support the idea.
Let me know what you think about it and we can help to drive it further.

sandeepvinayak force-pushed the spal-transactions branch from e452b85 to a3911cb Compare October 11, 2024 21:33
sandeepvinayak mentioned this pull request Oct 11, 2024
sandeepvinayak force-pushed the spal-transactions branch from a3911cb to 541d19a Compare October 11, 2024 21:38
sandeepvinayak force-pushed the spal-transactions branch 2 times, most recently from bcf60ed to 04a45a7 Compare December 7, 2024 09:15
sandeepvinayak force-pushed the spal-transactions branch from 04a45a7 to c95f790 Compare December 7, 2024 09:17
sandeepvinayak changed the title WIP: Support transaction in the docstore Support atomic writes in the docstore Dec 7, 2024
jba added a commit that referenced this pull request Dec 14, 2024
All modules are on a Go version after 1.18, so we can rename
interface{} to any to modernize the code.

docstore is omitted, because there are PRs in flight that this might
conflict with (#3500, #3508).
jba mentioned this pull request Dec 14, 2024
jba requested changes Jan 16, 2025
if len(actions) == 0 {
return
}
setErr := func(err error) {
Copy link
Contributor

jba Jan 16, 2025

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

The idea here is that if anything in this function fails, everything fails (since it's atomic). Document that here.

return "[" + strings.Join(as, ", ") + "]"
}

// AtomicWrites causes all following writes in the list to execute atomically.
Copy link
Contributor

jba Jan 16, 2025

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

"to execute as a single atomic operation"

(to avoid confusion with the fact that each write already happens atomically by itself)

sandeepvinayak reacted with thumbs up emoji
@@ -79,7 +79,7 @@ func TestGroupActions(t *testing.T) {
}{
{
Copy link
Contributor

jba Jan 16, 2025

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Please add various cases involving atomic writes, mixed with other writes and gets before, after, and concurrently.

sandeepvinayak reacted with thumbs up emoji
sandeepvinayak force-pushed the spal-transactions branch 2 times, most recently from d87f80e to aa357b9 Compare January 22, 2025 01:23
sandeepvinayak force-pushed the spal-transactions branch from aa357b9 to c8a11bd Compare January 22, 2025 01:26
sandeepvinayak requested a review from jba January 22, 2025 01:26
Copy link
Contributor Author

sandeepvinayak commented Jan 22, 2025

@jba thanks for your feedback, I addressed all of the comments, please take another look

jba requested changes Jan 22, 2025
sandeepvinayak force-pushed the spal-transactions branch from e46f0b9 to 9c979be Compare January 22, 2025 21:16
Copy link
Contributor Author

sandeepvinayak commented Jan 22, 2025

@jba, I addressed your latest 2 comments

sandeepvinayak requested a review from jba January 22, 2025 21:18
sandeepvinayak force-pushed the spal-transactions branch from 9c979be to 6a57b2f Compare January 22, 2025 22:32
sandeepvinayak force-pushed the spal-transactions branch from 6a57b2f to 8d0616d Compare January 23, 2025 04:10
jba approved these changes Jan 23, 2025
Copy link

codecov bot commented Jan 23, 2025 *
edited
Loading

Codecov Report

Attention: Patch coverage is 71.79487% with 11 lines in your changes missing coverage. Please review.

Project coverage is 73.28%. Comparing base (61f69d3) to head (8d0616d).
Report is 4 commits behind head on master.

Files with missing lines Patch % Lines
docstore/awsdynamodb/dynamo.go 46.66% 8 Missing
docstore/docstore.go 75.00% 3 Missing
Additional details and impacted files
@@ Coverage Diff @@
## master #3500 +/- ##
==========================================
+ Coverage 73.26% 73.28% +0.01%
==========================================
Files 113 113
Lines 15065 15080 +15
==========================================
+ Hits 11038 11051 +13
- Misses 3261 3263 +2
Partials 766 766

View full report in Codecov by Sentry.
Have feedback on the report? Share it here.

Copy link
Contributor Author

sandeepvinayak commented Jan 23, 2025 *
edited
Loading

@jba the codecov report is under-reporting because the conformance tests are disabled for now but I verified the tests we added are good for dynamo. I will enable the 2 conformance tests added along with the other providers in the follow up PR.

jba merged commit 4d1f585 into google:master Jan 23, 2025
6 checks passed
Copy link
Contributor

jba commented Jan 23, 2025

Thanks for the PR! Looking forward to the follow-ups.

sandeepvinayak reacted with thumbs up emoji

sandeepvinayak added a commit to sandeepvinayak/go-cloud that referenced this pull request Apr 10, 2025
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Reviewers

jba jba approved these changes

Assignees

No one assigned

Labels

None yet

Projects

None yet

Milestone

No milestone

Development

Successfully merging this pull request may close these issues.

2 participants