Skip to content
Merged
Show file tree
Hide file tree
Changes from 4 commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
6 changes: 0 additions & 6 deletions muted-tests.yml
Original file line number Diff line number Diff line change
Expand Up @@ -564,12 +564,6 @@ tests:
- class: org.elasticsearch.gradle.internal.transport.TransportVersionValidationFuncTest
method: definitions have primary ids which cannot change
issue: https://github.com/elastic/elasticsearch/issues/133131
- class: org.elasticsearch.xpack.esql.action.RandomizedTimeSeriesIT
method: testGroupBySubset
issue: https://github.com/elastic/elasticsearch/issues/133220
- class: org.elasticsearch.xpack.esql.action.RandomizedTimeSeriesIT
method: testGroupByNothing
issue: https://github.com/elastic/elasticsearch/issues/133225
- class: org.elasticsearch.gradle.internal.transport.TransportVersionValidationFuncTest
method: named and unreferenced definitions cannot have the same name
issue: https://github.com/elastic/elasticsearch/issues/133255
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -183,10 +183,18 @@ public void populateIndex() throws IOException {
if (documents == null) {
documents = new ArrayList<>();
}
documents.add(document);
var indexRequest = client().prepareIndex(DATASTREAM_NAME).setOpType(DocWriteRequest.OpType.CREATE).setSource(document);
indexRequest.setRefreshPolicy(org.elasticsearch.action.support.WriteRequest.RefreshPolicy.IMMEDIATE);
indexRequest.get();
try {
var indexRequest = client().prepareIndex(DATASTREAM_NAME).setOpType(DocWriteRequest.OpType.CREATE).setSource(document);
indexRequest.setRefreshPolicy(org.elasticsearch.action.support.WriteRequest.RefreshPolicy.IMMEDIATE);
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.

if (e.getMessage() != null && e.getMessage().contains("version conflict")) {
continue;
}
throw e;
}
}
}

Expand Down