Conversation
Member
Author
|
cc @mkabischev |
vitkovskii
reviewed
Apr 3, 2020
| // This also will control the size of file writer buffer. | ||
| buf := make([]byte, 32*1024) | ||
| bw, err := newBinaryWriter(fn, buf) | ||
| bw, err := newBinaryWriter(tmpFilename+".tmp", buf) |
Fixes #2213 This caused was indicated as regression of latency, and also causes potential critical issue for store GW, where manual delete of index-header from local storage was required. This might be considered as blocker for 0.12, so it would be worth to port it to 0.12 TBH @squat. Signed-off-by: Bartlomiej Plotka <bwplotka@gmail.com>
GiedriusS
reviewed
Apr 3, 2020
| return errors.Wrap(err, "new binary index header writer") | ||
| } | ||
| defer runutil.CloseWithErrCapture(&err, bw, "close binary writer for %s", fn) | ||
| defer runutil.CloseWithErrCapture(&err, bw, "close binary writer for %s", tmpFilename) |
Member
There was a problem hiding this comment.
Since binaryWriter.Close() calls FileWriter.Close() which does file.Sync() and file.Flush() maybe it would be worth being extra careful and explicitly calling it before os.Rename?
Or we could do another round of:
if err := bw.f.Flush(); err != nil {
return errors.Wrap(err, "flush")
}
& Sync(). WDYT?
Member
Author
There was a problem hiding this comment.
Thanks for this good point
Member
|
if we want this in v0.12.0, should we instead PR into release-0.12? |
Member
Author
|
Yes, will do with @GiedriusS fixes. |
Merged
Member
|
Correct me if I'm wrong, but I think we can close this as we're going to be merging this into master when we merge |
Member
|
ack we can close this now @brancz 👍 |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Fixes #2213
This cause was indicated as the potential root cause for regression of latency and also causes the potentially critical issue
for store GW, where manual delete of index-header from local storage was required.
This might be considered as a blocker for 0.12, so it would be worth it to port it to 0.12 TBH @squat WDYT?
Signed-off-by: Bartlomiej Plotka bwplotka@gmail.com