Skip to content

Commit 9641518

Browse files
committed
Explain
1 parent 4fed32c commit 9641518

File tree

1 file changed

+8
-2
lines changed
  • test/external-modules/esql-heap-attack/src/javaRestTest/java/org/elasticsearch/xpack/esql/heap_attack

1 file changed

+8
-2
lines changed

test/external-modules/esql-heap-attack/src/javaRestTest/java/org/elasticsearch/xpack/esql/heap_attack/HeapAttackIT.java

Lines changed: 8 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -620,14 +620,20 @@ private Map<String, Object> aggManyBigFields(int fields) throws IOException {
620620
return responseAsMap(query(query.toString(), "columns,values"));
621621
}
622622

623+
/**
624+
* Aggregates on the {@code LENGTH} of a giant text field. Without
625+
* splitting pages on load (#131053) this throws a {@link CircuitBreakingException}
626+
* when it tries to load a giant field. With that change it finishes
627+
* after loading many single-row pages.
628+
*/
623629
public void testAggGiantTextField() throws IOException {
624630
int docs = 100;
625631
initGiantTextField(docs);
626632
Map<?, ?> response = aggGiantTextField();
627633
ListMatcher columns = matchesList().item(matchesMap().entry("name", "sum").entry("type", "long"));
628634
assertMap(
629635
response,
630-
matchesMap().entry("columns", columns).entry("values", matchesList().item(matchesList().item(1024 * 1024 * docs)))
636+
matchesMap().entry("columns", columns).entry("values", matchesList().item(matchesList().item(1024 * 1024 * 5 * docs)))
631637
);
632638
}
633639

@@ -880,7 +886,7 @@ private void initManyBigFieldsIndex(int docs, String type) throws IOException {
880886
private void initGiantTextField(int docs) throws IOException {
881887
logger.info("loading many documents with one big text field");
882888
int docsPerBulk = 5;
883-
int fieldSize = Math.toIntExact(ByteSizeValue.ofMb(1).getBytes());
889+
int fieldSize = Math.toIntExact(ByteSizeValue.ofMb(5).getBytes());
884890

885891
Request request = new Request("PUT", "/bigtext");
886892
XContentBuilder config = JsonXContent.contentBuilder().startObject();

0 commit comments

Comments
 (0)