Skip to content

Conversation

pabloem
Copy link
Contributor

@pabloem pabloem commented Aug 25, 2025

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

@elasticsearchmachine elasticsearchmachine added v9.2.0 needs:triage Requires assignment of a team area label labels Aug 25, 2025
@pabloem pabloem added >bug :StorageEngine/TSDB You know, for Metrics and removed needs:triage Requires assignment of a team area label labels Aug 25, 2025
@pabloem pabloem requested a review from kkrik-es August 25, 2025 16:44
@elasticsearchmachine
Copy link
Collaborator

Pinging @elastic/es-storage-engine (Team:StorageEngine)

@pabloem pabloem requested a review from not-napoleon August 25, 2025 19:07
indexRequest.get();
documents.add(document);
} catch (Exception e) {
// Ignore version conflicts, which can happen due to retries on the client side
Copy link
Contributor

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?

Copy link
Contributor Author

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.

@kkrik-es
Copy link
Contributor

Let's make sure the description always explains the underlying problem and the fix - no need to make it too long.

@kkrik-es kkrik-es added >test Issues or PRs that are addressing/adding tests and removed >bug labels Aug 26, 2025
@pabloem pabloem changed the title fixing flakiness in RandomizedTimeSeriesIT fixing flakiness in RandomizedTimeSeriesIT - generating unique timestamps Aug 27, 2025
@pabloem pabloem requested a review from kkrik-es August 28, 2025 03:35
@pabloem
Copy link
Contributor Author

pabloem commented Aug 28, 2025

@kkrik-es done! LMK if my fix is fine.

@pabloem pabloem merged commit a130929 into elastic:main Aug 28, 2025
33 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

:StorageEngine/TSDB You know, for Metrics Team:StorageEngine >test Issues or PRs that are addressing/adding tests v9.2.0

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants