forked from elastic/elasticsearch
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Fail and close translog hard if writing to disk fails
Today we are super lenient (how could I missed that for f**k sake) with failing / closing the translog writer when we hit an exception. It's actually worse, we allow to further write to it and don't care what has been already written to disk and what hasn't. We keep the buffer in memory and try to write it again on the next operation. When we hit a disk-full expcetion due to for instance a big merge we are likely adding document to the translog but fail to write them to disk. Once the merge failed and freed up it's diskspace (note this is a small window when concurrently indexing and failing the shard due to out of space exceptions) we will allow in-flight operations to add to the translog and then once we fail the shard fsync it. These operations are written to disk and fsynced which is fine but the previous buffer flush might have written some bytes to disk which are not corrupting the translog. That wouldn't be an issue if we prevented the fsync. Closes elastic#15333
- Loading branch information
Showing
6 changed files
with
218 additions
and
56 deletions.
There are no files selected for viewing
This file contains 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
This file contains 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
This file contains 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
This file contains 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
This file contains 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
Oops, something went wrong.