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

Do not create empty .vac files in metadata consolidation #5453

Merged
merged 1 commit into from
Feb 13, 2025

Conversation

ypatia
Copy link
Member

@ypatia ypatia commented Feb 13, 2025

When we are trying to consolidate array or group metadata but there are no array or group metadata present, we are creating an empty .vac file on local filesystems. In object stores, notably on S3 that I have tested, our write method currently doesn't create a file when size is 0 (this is most probably another issue to fix), so we don't observe the same behavior.

This PR unifies the behavior by enforcing that we don't create a .vac file if no consolidation is possible, aka if there are 0 or 1 array/group metadata present. We already do such a check for fragment metadata, fragments and commit consolidation.
Both tests in this PR were failing without the fix and are now passing.


TYPE: BUG
DESC: Do not create empty .vac files in metadata consolidation

Copy link
Member

@teo-tsirpanis teo-tsirpanis left a comment

Choose a reason for hiding this comment

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

Thanks!

@@ -80,6 +80,12 @@ Status ArrayMetaConsolidator::consolidate(
encryption_key,
key_length));

// Check if there's actually more than 1 file to consolidate
auto& metadata_r = array_for_reads.metadata();
if (metadata_r.loaded_metadata_uris().size() <= 1) {
Copy link
Member

Choose a reason for hiding this comment

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

I had thought about using array_for_reads.array_directory().array_meta_uris() but it's the same thing.

@teo-tsirpanis teo-tsirpanis merged commit a22fe13 into main Feb 13, 2025
60 checks passed
@teo-tsirpanis teo-tsirpanis deleted the yt/sc-62900/s3_error_emtpy_vac branch February 13, 2025 19:48
ihnorton pushed a commit that referenced this pull request Feb 18, 2025
When we are trying to consolidate array or group metadata but there are
no array or group metadata present, we are creating an empty `.vac` file
on local filesystems. In object stores, notably on S3 that I have
tested, our `write` method currently doesn't create a file when size is
`0` (this is most probably another issue to fix), so we don't observe
the same behavior.

This PR unifies the behavior by enforcing that we don't create a `.vac`
file if no consolidation is possible, aka if there are 0 or 1
array/group metadata present. We already do such a check for fragment
metadata, fragments and commit consolidation.
Both tests in this PR were failing without the fix and are now passing.

---
TYPE: BUG
DESC: Do not create empty .vac files in metadata consolidation

(cherry picked from commit a22fe13)
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