-
Notifications
You must be signed in to change notification settings - Fork 25.6k
fixing flakiness in RandomizedTimeSeriesIT - generating unique timestamps #133489
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
Conversation
Pinging @elastic/es-storage-engine (Team:StorageEngine) |
indexRequest.get(); | ||
documents.add(document); | ||
} catch (Exception e) { | ||
// Ignore version conflicts, which can happen due to retries on the client side |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
What does this mean? I think version conflicts point to documents with the same tsid and timestamp.
Can we make sure we generate unique timestamps instead?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
implemented that. lmk what you think.
Why not using randomInstantBetween?
Because that function uses nanosecond precision but ES stores millisecond precision, so we can have collisions that are not captured by the set.
Let's make sure the description always explains the underlying problem and the fix - no need to make it too long. |
@kkrik-es done! LMK if my fix is fine. |
These test cases would fail in the setup phase because on occasion, the same document was randomly generated twice (specifically, same timeseries and same timestamp). This change ensures that this no longer happen by generating each timestamp only once.
fixing