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

[extension/storage/filestorage] Ensure fsync is turned on after compaction #31185

Merged
merged 3 commits into from
Feb 12, 2024
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
2 changes: 1 addition & 1 deletion extension/storage/filestorage/client.go
Original file line number Diff line number Diff line change
Expand Up @@ -172,7 +172,7 @@ func (c *fileStorageClient) Compact(compactionDirectory string, timeout time.Dur
}()

// use temporary file as compaction target
options := bboltOptions(timeout, false)
options := bboltOptions(timeout, !c.db.NoSync)
Copy link
Member

@djaglowski djaglowski Feb 12, 2024

Choose a reason for hiding this comment

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

Thanks for fixing this.

Could I ask a minor related item, that we invert and rename the fSync parameter we're passing around to noSync and invert the usage? (within the functions but also Also requires inverting the value here.) This would allow us to avoid the double negative here.

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Yeah works for me.

Do you also want to change the config option? I think it's best to have fsync on by default unless you really know what you're doing, since it can cause data loss and crash looping of otelcol. But maybe that should be a separate PR

Copy link
Member

Choose a reason for hiding this comment

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

Do you also want to change the config option? I think it's best to have fsync on by default unless you really know what you're doing, since it can cause data loss and crash looping of otelcol. But maybe that should be a separate PR

Let's discuss this separately. In theory we are committed to keep the config stable once the component is in beta but if it is important enough we can probably do it with a feature gate and/or new parameter.

Copy link
Member

Choose a reason for hiding this comment

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

If you don't mind, please open a new issue to propose the change.


c.compactionMutex.Lock()
defer c.compactionMutex.Unlock()
Expand Down