Skip to content
Merged
Changes from 1 commit
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
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,6 @@
import org.apache.lucene.tests.util.LuceneTestCase;
import org.elasticsearch.ExceptionsHelper;
import org.elasticsearch.action.ActionListener;
import org.elasticsearch.action.admin.indices.stats.IndicesStatsRequest;
import org.elasticsearch.action.bulk.BulkRequestBuilder;
import org.elasticsearch.action.support.WriteRequest;
import org.elasticsearch.cluster.metadata.IndexMetadata;
Expand Down Expand Up @@ -283,17 +282,7 @@ public void testCancelUnnecessaryRequests() {
try {
var result = safeExecute(client(coordinatingNode), EsqlQueryAction.INSTANCE, query);
assertThat(Iterables.size(result.rows()), equalTo(1L));
assertThat(exchanges.get(), lessThanOrEqualTo(1));// 0 if result is populated from coordinating node
} catch (AssertionError e) {
client().admin().indices().stats(new IndicesStatsRequest()).actionGet().asMap().forEach((shard, stats) -> {
logger.info(
"Shard {} node {} status {} docs {}",
shard.shardId(),
shard.currentNodeId(),
shard.state(),
stats.getStats().getDocs().getCount()
);
});
Comment on lines -287 to -296
Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This was not bubbling up exception if/when that happens

assertThat(exchanges.get(), lessThanOrEqualTo(2));
Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Once above was fixed I noticed that 1-8% depending on the load of the times the test was failing.

Since processing pages and sending more requests happens on different threads of different threadpools, we can not guarantee that incoming page is processed before the next request is sent.

It looks like in practice we accumulate enough results (1 row) before the third request is sent.
This still shows that we do not send request to every node (there are at minimum 3 data nodes in this test).

} finally {
coordinatorNodeTransport.clearAllRules();
}
Expand Down