-
Notifications
You must be signed in to change notification settings - Fork 3.9k
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
blobfixture: create utility for managing blob fixtures #140368
blobfixture: create utility for managing blob fixtures #140368
Conversation
Previously, backup fixture creation was a manual process. Now, fixture creation will run as a roachtest and use the fixture registry utility added by cockroachdb#140368. Fixture generation was reworked to use import instead of old backup fixtures. This makes it trivial to bootstrap fixtures in new clouds and in new fixture buckets. Release note: none Part of: cockroachdb#139159
0905435
to
05449e0
Compare
Previously, backup fixture creation was a manual process. Now, fixture creation will run as a roachtest and use the fixture registry utility added by cockroachdb#140368. Fixture generation was reworked to use import instead of old backup fixtures. This makes it trivial to bootstrap fixtures in new clouds and in new fixture buckets. Release note: none Part of: cockroachdb#139159
Previously, backup fixture creation was a manual process. Now, fixture creation will run as a roachtest and use the fixture registry utility added by cockroachdb#140368. Fixture generation was reworked to use import instead of old backup fixtures. This makes it trivial to bootstrap fixtures in new clouds and in new fixture buckets. Release note: none Part of: cockroachdb#139159
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This is awesome!! Left mostly nits
|
||
func (r *Registry) deleteBlobsMatchingPrefix(prefix string) error { | ||
return r.storage.List(context.Background(), prefix, "", func(path string) error { | ||
return r.storage.Delete(context.Background(), prefix+path) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
i hope this scales!
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
The list is going to be fast. We may need to parallelize the deletes, but I'm trying to write the simplest possible code on the first pass.
// 'nodelocal://' support is a little hacky and is only intended to support | ||
// testing fixture generation in local tests. | ||
node := uri.Host | ||
root := path.Join(os.Getenv("HOME"), "local", node, "data", "extern") |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
i assume you used this in demo? It may be worth adding a baby unit test to ensure this works.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I ended up removing all support for nodelocal for now. I did use it when testing fixture generation. I think it would be possible to make this work in the future by creating a fixture directory somewhere on the local machine and linking it into the external data directory when the roachprod cluster is created. But I don't want to do that right now.
@@ -49,17 +49,14 @@ func ReplaceNodeLocalForTesting(root string) func() { | |||
func TestingMakeNodelocalStorage( | |||
root string, settings *cluster.Settings, es cloudpb.ExternalStorage, | |||
) cloud.ExternalStorage { | |||
if !buildutil.CrdbTestBuild { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
could you provide more context on this change? It seems unrelated to the rest of this commit.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I removed this from the PR and may do something like this in the future if I add local support.
The motivation for this change is the roachtest
and roachprod
binaries are not considered test binaries. So calling this would panic.
// GC deletes fixtures that were leaked or obsolete. See the comment on the | ||
// fixturesToGc for details about the GC policy. | ||
func (r *Registry) GC(ctx context.Context, l *logger.Logger) error { | ||
// List objects in /roachtest/v25.1/metadata |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
The comment is perhaps a hint that this package should really be inside roachtest
proper. Roachprod is used outside of roachtest, so we want to keep them loosely coupled, when possible.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I don't have strong opinions as to where this goes, but I put it in roachprod because I considered adding a roachprod command that restores fixtures into a roachprod cluster or prints the uri for the latest copy of a fixture.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Ah, in that case it makes sense. I also wondered if there would be a self-contained command (via CLI).
05449e0
to
6e51494
Compare
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I'm very excited for this.
Previously, backup fixture creation was a manual process. Now, fixture creation will run as a roachtest and use the fixture registry utility added by cockroachdb#140368. Fixture generation was reworked to use import instead of old backup fixtures. This makes it trivial to bootstrap fixtures in new clouds and in new fixture buckets. Release note: none Part of: cockroachdb#139159
Previously, backup fixture creation was a manual process. Now, fixture creation will run as a roachtest and use the fixture registry utility added by cockroachdb#140368. Fixture generation was reworked to use import instead of old backup fixtures. This makes it trivial to bootstrap fixtures in new clouds and in new fixture buckets. Release note: none Part of: cockroachdb#139159
This introduces the `blobfixture` package. It will be used by the DR team to manage the lifetime of fixtures created for restore roachtests. Currently, fixture generation is a manual process so many of our fixtures date back to 22.2. blobfixture has two features which allow for automated fixture generation: 1. There is an explicit step to mark a fixture as ready. This prevents a restore roachtest from attempting to use a fixture that is in the process of creation. 2. It garbage collects old fixtures. The GC is easy to retrofit once we start tracking fixture ready time. GC is superior to using a TTL because we don't throw away fixtures if fixture creation breaks and we can delete fixtures more aggressively than if we depended on TTL, which helps minimize the cost of the fixtures. Release note: none Part of: 139159
6e51494
to
118501a
Compare
Previously, backup fixture creation was a manual process. Now, fixture creation will run as a roachtest and use the fixture registry utility added by cockroachdb#140368. Fixture generation was reworked to use import instead of old backup fixtures. This makes it trivial to bootstrap fixtures in new clouds and in new fixture buckets. Release note: none Part of: cockroachdb#139159
Previously, backup fixture creation was a manual process. Now, fixture creation will run as a roachtest and use the fixture registry utility added by cockroachdb#140368. Fixture generation was reworked to use import instead of old backup fixtures. This makes it trivial to bootstrap fixtures in new clouds and in new fixture buckets. Release note: none Part of: cockroachdb#139159
Previously, backup fixture creation was a manual process. Now, fixture creation will run as a roachtest and use the fixture registry utility added by cockroachdb#140368. Fixture generation was reworked to use import instead of old backup fixtures. This makes it trivial to bootstrap fixtures in new clouds and in new fixture buckets. Release note: none Part of: cockroachdb#139159
Previously, backup fixture creation was a manual process. Now, fixture creation will run as a roachtest and use the fixture registry utility added by cockroachdb#140368. Fixture generation was reworked to use import instead of old backup fixtures. This makes it trivial to bootstrap fixtures in new clouds and in new fixture buckets. Release note: none Part of: cockroachdb#139159
Previously, backup fixture creation was a manual process. Now, fixture creation will run as a roachtest and use the fixture registry utility added by cockroachdb#140368. Fixture generation was reworked to use import instead of old backup fixtures. This makes it trivial to bootstrap fixtures in new clouds and in new fixture buckets. Release note: none Part of: cockroachdb#139159
Previously, backup fixture creation was a manual process. Now, fixture creation will run as a roachtest and use the fixture registry utility added by cockroachdb#140368. Fixture generation was reworked to use import instead of old backup fixtures. This makes it trivial to bootstrap fixtures in new clouds and in new fixture buckets. Release note: none Part of: cockroachdb#139159
Previously, backup fixture creation was a manual process. Now, fixture creation will run as a roachtest and use the fixture registry utility added by cockroachdb#140368. Fixture generation was reworked to use import instead of old backup fixtures. This makes it trivial to bootstrap fixtures in new clouds and in new fixture buckets. Release note: none Part of: cockroachdb#139159
Previously, backup fixture creation was a manual process. Now, fixture creation will run as a roachtest and use the fixture registry utility added by cockroachdb#140368. Fixture generation was reworked to use import instead of old backup fixtures. This makes it trivial to bootstrap fixtures in new clouds and in new fixture buckets. Release note: none Part of: cockroachdb#139159
Previously, backup fixture creation was a manual process. Now, fixture creation will run as a roachtest and use the fixture registry utility added by cockroachdb#140368. Fixture generation was reworked to use import instead of old backup fixtures. This makes it trivial to bootstrap fixtures in new clouds and in new fixture buckets. Release note: none Part of: cockroachdb#139159
Previously, backup fixture creation was a manual process. Now, fixture creation will run as a roachtest and use the fixture registry utility added by cockroachdb#140368. Fixture generation was reworked to use import instead of old backup fixtures. This makes it trivial to bootstrap fixtures in new clouds and in new fixture buckets. Release note: none Part of: cockroachdb#139159
Previously, backup fixture creation was a manual process. Now, fixture creation will run as a roachtest and use the fixture registry utility added by cockroachdb#140368. Fixture generation was reworked to use import instead of old backup fixtures. This makes it trivial to bootstrap fixtures in new clouds and in new fixture buckets. Release note: none Part of: cockroachdb#139159
Previously, backup fixture creation was a manual process. Now, fixture creation will run as a roachtest and use the fixture registry utility added by cockroachdb#140368. Fixture generation was reworked to use import instead of old backup fixtures. This makes it trivial to bootstrap fixtures in new clouds and in new fixture buckets. Release note: none Part of: cockroachdb#139159
Previously, backup fixture creation was a manual process. Now, fixture creation will run as a roachtest and use the fixture registry utility added by cockroachdb#140368. Fixture generation was reworked to use import instead of old backup fixtures. This makes it trivial to bootstrap fixtures in new clouds and in new fixture buckets. Release note: none Part of: cockroachdb#139159
Previously, backup fixture creation was a manual process. Now, fixture creation will run as a roachtest and use the fixture registry utility added by cockroachdb#140368. Fixture generation was reworked to use import instead of old backup fixtures. This makes it trivial to bootstrap fixtures in new clouds and in new fixture buckets. Release note: none Part of: cockroachdb#139159
Previously, backup fixture creation was a manual process. Now, fixture creation will run as a roachtest and use the fixture registry utility added by cockroachdb#140368. Fixture generation was reworked to use import instead of old backup fixtures. This makes it trivial to bootstrap fixtures in new clouds and in new fixture buckets. Release note: none Part of: cockroachdb#139159
Thanks for the reviews! bors r+ |
Previously, backup fixture creation was a manual process. Now, fixture creation will run as a roachtest and use the fixture registry utility added by cockroachdb#140368. Fixture generation was reworked to use import instead of old backup fixtures. This makes it trivial to bootstrap fixtures in new clouds and in new fixture buckets. Release note: none Part of: cockroachdb#139159
Previously, backup fixture creation was a manual process. Now, fixture creation will run as a roachtest and use the fixture registry utility added by cockroachdb#140368. Fixture generation was reworked to use import instead of old backup fixtures. This makes it trivial to bootstrap fixtures in new clouds and in new fixture buckets. Release note: none Part of: cockroachdb#139159
Previously, backup fixture creation was a manual process. Now, fixture creation will run as a roachtest and use the fixture registry utility added by cockroachdb#140368. Fixture generation was reworked to use import instead of old backup fixtures. This makes it trivial to bootstrap fixtures in new clouds and in new fixture buckets. Release note: none Part of: cockroachdb#139159
Previously, backup fixture creation was a manual process. Now, fixture creation will run as a roachtest and use the fixture registry utility added by cockroachdb#140368. Fixture generation was reworked to use import instead of old backup fixtures. This makes it trivial to bootstrap fixtures in new clouds and in new fixture buckets. Release note: none Part of: cockroachdb#139159
Previously, backup fixture creation was a manual process. Now, fixture creation will run as a roachtest and use the fixture registry utility added by cockroachdb#140368. Fixture generation was reworked to use import instead of old backup fixtures. This makes it trivial to bootstrap fixtures in new clouds and in new fixture buckets. Release note: none Part of: cockroachdb#139159
Previously, backup fixture creation was a manual process. Now, fixture creation will run as a roachtest and use the fixture registry utility added by cockroachdb#140368. Fixture generation was reworked to use import instead of old backup fixtures. This makes it trivial to bootstrap fixtures in new clouds and in new fixture buckets. Release note: none Part of: cockroachdb#139159
Previously, backup fixture creation was a manual process. Now, fixture creation will run as a roachtest and use the fixture registry utility added by cockroachdb#140368. Fixture generation was reworked to use import instead of old backup fixtures. This makes it trivial to bootstrap fixtures in new clouds and in new fixture buckets. Release note: none Part of: cockroachdb#139159
Previously, backup fixture creation was a manual process. Now, fixture creation will run as a roachtest and use the fixture registry utility added by cockroachdb#140368. Fixture generation was reworked to use import instead of old backup fixtures. This makes it trivial to bootstrap fixtures in new clouds and in new fixture buckets. Release note: none Part of: cockroachdb#139159
Previously, backup fixture creation was a manual process. Now, fixture creation will run as a roachtest and use the fixture registry utility added by cockroachdb#140368. Fixture generation was reworked to use import instead of old backup fixtures. This makes it trivial to bootstrap fixtures in new clouds and in new fixture buckets. Release note: none Part of: cockroachdb#139159
Previously, backup fixture creation was a manual process. Now, fixture creation will run as a roachtest and use the fixture registry utility added by cockroachdb#140368. Fixture generation was reworked to use import instead of old backup fixtures. This makes it trivial to bootstrap fixtures in new clouds and in new fixture buckets. Release note: none Part of: cockroachdb#139159
Previously, backup fixture creation was a manual process. Now, fixture creation will run as a roachtest and use the fixture registry utility added by cockroachdb#140368. Fixture generation was reworked to use import instead of old backup fixtures. This makes it trivial to bootstrap fixtures in new clouds and in new fixture buckets. Release note: none Part of: cockroachdb#139159
Previously, backup fixture creation was a manual process. Now, fixture creation will run as a roachtest and use the fixture registry utility added by cockroachdb#140368. Fixture generation was reworked to use import instead of old backup fixtures. This makes it trivial to bootstrap fixtures in new clouds and in new fixture buckets. Release note: none Part of: cockroachdb#139159
This introduces the
blobfixture
package. It will be used by the DR team to manage the lifetime of fixtures created for restore roachtests. Currently, fixture generation is a manual process so many of our fixtures date back to 22.2. blobfixture has two features which allow for automated fixture generation:Release note: none
Part of: #139159