From f2adaebba28b5e47ea03a850254e901a0c7be371 Mon Sep 17 00:00:00 2001 From: Dave Marion Date: Thu, 22 Feb 2024 17:50:03 +0000 Subject: [PATCH 1/2] Removed extra braces in string added as part of #4289 --- .../java/org/apache/accumulo/core/conf/ConfigCheckUtil.java | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/core/src/main/java/org/apache/accumulo/core/conf/ConfigCheckUtil.java b/core/src/main/java/org/apache/accumulo/core/conf/ConfigCheckUtil.java index ba3e7e543f2..eba5cc420f3 100644 --- a/core/src/main/java/org/apache/accumulo/core/conf/ConfigCheckUtil.java +++ b/core/src/main/java/org/apache/accumulo/core/conf/ConfigCheckUtil.java @@ -57,7 +57,7 @@ public static void validate(Iterable> entries, @NonNull Str } else if (prop == null) { log.warn(PREFIX + "unrecognized property key ({}) for {}", key, source); } else if (prop.getType() == PropertyType.PREFIX) { - fatal(PREFIX + "incomplete property key (" + key + ") for {}" + source); + fatal(PREFIX + "incomplete property key (" + key + ") for " + source); } else if (!prop.getType().isValidFormat(value)) { fatal(PREFIX + "improperly formatted value for key (" + key + ", type=" + prop.getType() + ") : " + value + " for " + source); From 1a40aee54116416181576f3f10198033fe3235f3 Mon Sep 17 00:00:00 2001 From: Keith Turner Date: Thu, 22 Feb 2024 16:10:29 -0500 Subject: [PATCH 2/2] fixes intermittent failure in ScanConsistencyIT (#4292) The following failure was observed when running ScanConsistencyIT in the elasticity branch. ``` java.util.concurrent.ExecutionException: java.util.NoSuchElementException at java.base/java.util.concurrent.FutureTask.report(FutureTask.java:122) at java.base/java.util.concurrent.FutureTask.get(FutureTask.java:191) at org.apache.accumulo.test.ScanConsistencyIT.testConcurrentScanConsistency(ScanConsistencyIT.java:186) at java.base/java.lang.reflect.Method.invoke(Method.java:566) at java.base/java.util.concurrent.FutureTask.run(FutureTask.java:264) at java.base/java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1128) at java.base/java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:628) at java.base/java.lang.Thread.run(Thread.java:829) Caused by: java.util.NoSuchElementException at com.google.common.collect.MoreCollectors$ToOptionalState.getElement(MoreCollectors.java:163) at com.google.common.collect.MoreCollectors.lambda$static$1(MoreCollectors.java:75) at java.base/java.util.stream.ReferencePipeline.collect(ReferencePipeline.java:582) at org.apache.accumulo.test.ScanConsistencyIT$TableOpsTask.call(ScanConsistencyIT.java:685) at org.apache.accumulo.test.ScanConsistencyIT$TableOpsTask.call(ScanConsistencyIT.java:622) ... 4 more ``` This was caused by the test attempting to do a filter compaction when there was currently no data to delete. Added a check for this case in this commit. --- .../accumulo/test/ScanConsistencyIT.java | 33 ++++++++++--------- 1 file changed, 18 insertions(+), 15 deletions(-) diff --git a/test/src/main/java/org/apache/accumulo/test/ScanConsistencyIT.java b/test/src/main/java/org/apache/accumulo/test/ScanConsistencyIT.java index a882547a056..0c03de99b02 100644 --- a/test/src/main/java/org/apache/accumulo/test/ScanConsistencyIT.java +++ b/test/src/main/java/org/apache/accumulo/test/ScanConsistencyIT.java @@ -659,21 +659,24 @@ public String call() throws Exception { // 1 in 20 chance of doing a filter compaction. This compaction will delete a data set. var deletes = tctx.dataTracker.getDeletes(); - // The row has the format :, the following gets the generations - // from the rows. Expect the generation to be the same for a set of data to delete. - String gen = deletes.stream().map(m -> new String(m.getRow(), UTF_8)) - .map(row -> row.split(":")[1]).distinct().collect(MoreCollectors.onlyElement()); - - IteratorSetting iterSetting = - new IteratorSetting(100, "genfilter", GenerationFilter.class); - iterSetting.addOptions(Map.of("generation", gen)); - - // run a compaction that deletes every key with the specified generation. Must wait on the - // compaction because at the end of the test it will try to verify deleted data is not - // present. Must flush the table in case data to delete is still in memory. - tctx.client.tableOperations().compact(tctx.table, new CompactionConfig().setFlush(true) - .setWait(true).setIterators(List.of(iterSetting))); - numFilters++; + if (!deletes.isEmpty()) { + // The row has the format :, the following gets the generations + // from the rows. Expect the generation to be the same for a set of data to delete. + String gen = deletes.stream().map(m -> new String(m.getRow(), UTF_8)) + .map(row -> row.split(":")[1]).distinct().collect(MoreCollectors.onlyElement()); + + IteratorSetting iterSetting = + new IteratorSetting(100, "genfilter", GenerationFilter.class); + iterSetting.addOptions(Map.of("generation", gen)); + + // run a compaction that deletes every key with the specified generation. Must wait on + // the + // compaction because at the end of the test it will try to verify deleted data is not + // present. Must flush the table in case data to delete is still in memory. + tctx.client.tableOperations().compact(tctx.table, new CompactionConfig().setFlush(true) + .setWait(true).setIterators(List.of(iterSetting))); + numFilters++; + } } }