Add lower bound for translog generation threshold#23779
Merged
jasontedor merged 1 commit intoelastic:masterfrom Mar 28, 2017
Merged
Add lower bound for translog generation threshold#23779jasontedor merged 1 commit intoelastic:masterfrom
jasontedor merged 1 commit intoelastic:masterfrom
Conversation
The translog already occupies 43 bytes on disk when empty. If the translog generation threshold is below this, the flush thread can get stuck in an infinite repeatedly rolling the generation. This commit adds a lower bound on the translog generation to avoid this problem, however we keep the lower bound small for convenience in testing.
bleskes
approved these changes
Mar 28, 2017
| final Translog translog = shard.getEngine().getTranslog(); | ||
| final long generation = translog.currentFileGeneration(); | ||
| for (int i = 0; i < randomIntBetween(32, 128); i++) { | ||
| final int numberOfDocuments = randomIntBetween(32, 128); |
| * generation threshold. However, small thresholds are useful for testing so we | ||
| * do not add a large lower bound here. | ||
| */ | ||
| new ByteSizeValue(64, ByteSizeUnit.BYTES), |
Contributor
There was a problem hiding this comment.
I wonder if we should wire this to org.elasticsearch.index.translog.TranslogWriter#getHeaderLength(int) with a static constant somewhere.
Member
Author
There was a problem hiding this comment.
It's a good thought, and I thought about it after your suggestion. I would prefer to keep this predictable for now rather than having the minimum quietly change if we change the translog. I do not expect the header to be changing frequently, but we can revisit this if needed.
Contributor
|
to be clear - no need for another review. |
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.
The translog already occupies 43 bytes on disk when empty. If the translog generation threshold is below this, the flush thread can get stuck in an infinite loop repeatedly rolling the generation. This commit adds a lower bound on the translog generation to avoid this problem, however we keep the lower bound small for convenience in testing.
Relates #23606