Fix elasticsearch create index race condition error#641
Merged
pavolloffay merged 2 commits intojaegertracing:masterfrom Jan 12, 2018
Merged
Fix elasticsearch create index race condition error#641pavolloffay merged 2 commits intojaegertracing:masterfrom
pavolloffay merged 2 commits intojaegertracing:masterfrom
Conversation
4c68035 to
1f21f99
Compare
yurishkuro
reviewed
Jan 10, 2018
| if err != nil { | ||
| return s.logError(jsonSpan, err, "Failed to create index", s.logger) | ||
| eErr, ok := err.(*elastic.Error) | ||
| if !ok || eErr.Details.Type != "index_already_exists_exception" { |
black-adder
reviewed
Jan 11, 2018
| @@ -140,12 +141,15 @@ func (s *SpanWriter) createIndex(indexName string, mapping string, jsonSpan *jMo | |||
| exists, _ := s.client.IndexExists(indexName).Do(s.ctx) // don't need to check the error because the exists variable will be false anyway if there is an error | |||
| if !exists { | |||
| // if there are multiple collectors writing to the same elasticsearch host, if the collectors pass | |||
Contributor
There was a problem hiding this comment.
this whole sentence is kinda wonky now.
"if there are multiple collectors attempting to create the same index at once, we make sure the error is not index_already_exists_exception or else we return the error"
or something to that effect
black-adder
approved these changes
Jan 11, 2018
3119246 to
b64071b
Compare
|
Changes Unknown when pulling b64071b on pavolloffay:fix-es-index-race-condition into ** on jaegertracing:master**. |
Signed-off-by: Pavol Loffay <ploffay@redhat.com>
b64071b to
bedac86
Compare
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 #589