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

[no-release-notes] go/store/nbs: NomsBlockStore.UpdateManifest{,WithAppendix} pre-open table files before the manifest updates. #8903

Merged
merged 2 commits into from
Feb 28, 2025
Merged
Changes from 1 commit
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
22 changes: 14 additions & 8 deletions go/store/nbs/store.go
Original file line number Diff line number Diff line change
Expand Up @@ -288,12 +288,15 @@ func (nbs *NomsBlockStore) conjoinIfRequired(ctx context.Context) (bool, error)
}
}

func (nbs *NomsBlockStore) UpdateManifest(ctx context.Context, updates map[hash.Hash]uint32) (mi ManifestInfo, err error) {
err = nbs.checkAllManifestUpdatesExist(ctx, updates)
func (nbs *NomsBlockStore) UpdateManifest(ctx context.Context, updates map[hash.Hash]uint32) (ManifestInfo, error) {
chunkSources, _, err := nbs.openChunkSourcesForAddTableFiles(ctx, updates)
if err != nil {
return manifestContents{}, err
return manifestContents{}, nil
}
mi, _, err = nbs.updateManifestAddFiles(ctx, updates, nil, nil, nil)
// If these sources get added to the store, they will get cloned.
// Either way, we want to close these instances when we are done.
defer chunkSources.close()
mi, _, err := nbs.updateManifestAddFiles(ctx, updates, nil, nil, chunkSources)
return mi, err
}

Expand Down Expand Up @@ -403,12 +406,15 @@ func (nbs *NomsBlockStore) updateManifestAddFiles(ctx context.Context, updates m
return updatedContents, false, nil
}

func (nbs *NomsBlockStore) UpdateManifestWithAppendix(ctx context.Context, updates map[hash.Hash]uint32, option ManifestAppendixOption) (mi ManifestInfo, err error) {
err = nbs.checkAllManifestUpdatesExist(ctx, updates)
func (nbs *NomsBlockStore) UpdateManifestWithAppendix(ctx context.Context, updates map[hash.Hash]uint32, option ManifestAppendixOption) (ManifestInfo, error) {
chunkSources, _, err := nbs.openChunkSourcesForAddTableFiles(ctx, updates)
if err != nil {
return
return manifestContents{}, nil
}
mi, _, err = nbs.updateManifestAddFiles(ctx, updates, &option, nil, nil)
// If these sources get added to the store, they will get cloned.
// Either way, we want to close these instances when we are done.
defer chunkSources.close()
mi, _, err := nbs.updateManifestAddFiles(ctx, updates, &option, nil, chunkSources)
return mi, err
}

Expand Down
Loading