This is an automated email from the ASF dual-hosted git repository. kturner pushed a commit to branch elasticity in repository https://gitbox.apache.org/repos/asf/accumulo.git
The following commit(s) were added to refs/heads/elasticity by this push: new f8b18a0a67 fixes intermittent failure in LargeSplitRowIT (#4172) f8b18a0a67 is described below commit f8b18a0a67716d273038aa9fd31933dc89ce341d Author: Keith Turner <ktur...@apache.org> AuthorDate: Fri Jan 19 13:28:37 2024 -0500 fixes intermittent failure in LargeSplitRowIT (#4172) The way Accumulo finds splits in the elasticity branch changed in such a way that its finding splits points that it was not before. This was causing LargeSplitRowIT to fail sometimes. Adjusted to the test to work with the new way splits are found. --- .../org/apache/accumulo/test/LargeSplitRowIT.java | 19 +++++++++++++++---- 1 file changed, 15 insertions(+), 4 deletions(-) diff --git a/test/src/main/java/org/apache/accumulo/test/LargeSplitRowIT.java b/test/src/main/java/org/apache/accumulo/test/LargeSplitRowIT.java index 37e6816ee8..68c21d67dd 100644 --- a/test/src/main/java/org/apache/accumulo/test/LargeSplitRowIT.java +++ b/test/src/main/java/org/apache/accumulo/test/LargeSplitRowIT.java @@ -203,7 +203,10 @@ public class LargeSplitRowIT extends ConfigurableMacBase { public void automaticSplitLater() throws Exception { log.info("Split later"); try (AccumuloClient client = Accumulo.newClient().from(getClientProperties()).build()) { - final int max = 15; + // Generate large rows which have long common prefixes and therefore no split can be found. + // Setting max to 1 causes all rows to have long common prefixes. Setting a max of greater + // than 1 would generate a row with a short common prefix. + final int max = 1; automaticSplit(client, max, 1); Predicate<String> isNotNamespaceTable = @@ -211,6 +214,9 @@ public class LargeSplitRowIT extends ConfigurableMacBase { String tableName = client.tableOperations().list().stream().filter(isNotNamespaceTable) .findAny().orElseGet(() -> fail("couldn't find a table")); + // No splits should have been able to occur. + assertTrue(client.tableOperations().listSplits(tableName).isEmpty()); + try (BatchWriter batchWriter = client.createBatchWriter(tableName)) { byte[] data = new byte[10]; for (int j = max; j < 150; j++) { @@ -239,11 +245,12 @@ public class LargeSplitRowIT extends ConfigurableMacBase { private void automaticSplit(AccumuloClient client, int max, int spacing) throws Exception { // make a table and lower the configuration properties // @formatter:off + final int maxEndRow = 1000; Map<String,String> props = Map.of( Property.TABLE_SPLIT_THRESHOLD.getKey(), "10K", Property.TABLE_FILE_COMPRESSION_TYPE.getKey(), "none", Property.TABLE_FILE_COMPRESSED_BLOCK_SIZE.getKey(), "64", - Property.TABLE_MAX_END_ROW_SIZE.getKey(), "1000" + Property.TABLE_MAX_END_ROW_SIZE.getKey(), ""+maxEndRow ); // @formatter:on @@ -300,8 +307,12 @@ public class LargeSplitRowIT extends ConfigurableMacBase { assertEquals(numOfMutations, extra); assertEquals(max, count); - // Make sure no splits occurred in the table - assertTrue(client.tableOperations().listSplits(tableName).isEmpty()); + // Make sure any splits are below the threshold. Accumulo may shorten splits by examining the + // longest common prefix between consecutive rows. Since some rows in this data may have a + // short longest common prefix, splits could be found. Any splits found should be below the + // configured threshold. + assertTrue(client.tableOperations().listSplits(tableName).stream() + .allMatch(split -> split.getLength() < maxEndRow)); } }