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

Add support for integration in GCP storage #62

Merged
merged 3 commits into from
Jul 16, 2024

Conversation

AlCutter
Copy link
Collaborator

@AlCutter AlCutter commented Jul 15, 2024

This PR pulls in the integrate mix-in from #61 and uses it in the GCP storage.

Towards #23

@AlCutter AlCutter force-pushed the pr_integrate_gcp branch 4 times, most recently from fbe3369 to 64ab0e8 Compare July 16, 2024 11:08
@AlCutter AlCutter requested a review from mhutchinson July 16, 2024 11:15
@AlCutter AlCutter marked this pull request as ready for review July 16, 2024 11:15
Comment on lines +192 to 194
if err := errG.Wait(); err != nil {
return nil, err
}
Copy link
Contributor

Choose a reason for hiding this comment

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

Does this cause a problem if the first error is NotExist but another one is a real failure?

Copy link
Collaborator Author

Choose a reason for hiding this comment

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

Technically it's "fine" because the only time when we'd expect to see NotExist tiles is after the prewarm, so we're only fetching one at a time. But it also sucks, so I've changed the API to be more friendly to the new multi-fetch shape of things. Now "NotExist" is represented as a nil entry in the slice, and errors are reserved for bad situations.

if err := s.setEntryBundle(ctx, bundleIndex, fromSeq, &bundle); err != nil {
if !errors.Is(os.ErrExist, err) {
return err
}
Copy link
Contributor

Choose a reason for hiding this comment

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

It could be worth logging something here when a duplicate write has happened. What I'd actually prefer would be prometheus counters for successful write, error write, duplicate write, etc. But that can come later?

Copy link
Collaborator Author

Choose a reason for hiding this comment

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

FWIW the GCP impl already logs a (verbose level) message when it encounters an idempotent dupe write, but agree that metrics are the right thing.

}(ctx, k, v)
}
errG.Go(func() error {
//TODO: write out checkpoint
Copy link
Contributor

Choose a reason for hiding this comment

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

This is quite a load bearing TODO :-)

Copy link
Collaborator Author

Choose a reason for hiding this comment

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

Coming soon, to a PR near you! :)

@AlCutter AlCutter merged commit d2fb910 into transparency-dev:main Jul 16, 2024
4 checks passed
@AlCutter AlCutter deleted the pr_integrate_gcp branch July 16, 2024 13:37
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.

2 participants