From 69408e2eb59823342d53feda55614fbc6a6d4491 Mon Sep 17 00:00:00 2001 From: Keith Turner Date: Mon, 14 Jul 2025 16:19:59 +0000 Subject: [PATCH 1/6] WIP adds some scripts to test failing compactions --- bin/cingest | 4 ++ conf/accumulo-testing.properties | 13 +--- .../testing/continuous/ContinuousWalk.java | 12 +++- .../testing/continuous/CorruptEntry.java | 69 ++++++++++++++++++ .../continuous/FlakyBulkBatchWriter.java | 2 +- .../continuous/ValidatingIterator.java | 47 ++++++++++++ test/compation-failures/README.md | 15 ++++ test/compation-failures/setup-compactors.sh | 60 ++++++++++++++++ test/compation-failures/start-ingest.sh | 72 +++++++++++++++++++ 9 files changed, 280 insertions(+), 14 deletions(-) create mode 100644 src/main/java/org/apache/accumulo/testing/continuous/CorruptEntry.java create mode 100644 src/main/java/org/apache/accumulo/testing/continuous/ValidatingIterator.java create mode 100644 test/compation-failures/README.md create mode 100755 test/compation-failures/setup-compactors.sh create mode 100755 test/compation-failures/start-ingest.sh diff --git a/bin/cingest b/bin/cingest index 4ef312c6..26b20d46 100755 --- a/bin/cingest +++ b/bin/cingest @@ -39,6 +39,7 @@ Available applications: manysplits Repeatedly lowers the split threshold on a table to create many splits in order to test split performance bulk Create RFiles in a Map Reduce job and calls importDirectory if successful + corrupt Corrupts the first entry after the minimum row. Use -o test.ci.ingest.row.min to change the minimum. EOF } @@ -81,6 +82,9 @@ case "$1" in fi ci_main="${ci_package}.BulkIngest" ;; + corrupt) + ci_main="${ci_package}.CorruptEntry" + ;; *) echo "Unknown application: $1" print_usage diff --git a/conf/accumulo-testing.properties b/conf/accumulo-testing.properties index 7e4bc911..b22af96f 100644 --- a/conf/accumulo-testing.properties +++ b/conf/accumulo-testing.properties @@ -44,18 +44,9 @@ test.ci.common.accumulo.num.tablets=20 # Format: a,b|a,b,c|c test.ci.common.auths= # Accumulo tserver properties to set when creating a table -test.ci.common.accumulo.server.props=\ -tserver.compaction.major.service.cs1.planner=org.apache.accumulo.core.spi.compaction.DefaultCompactionPlanner \ -tserver.compaction.major.service.cs1.planner.opts.executors=\ -[{"name":"small","type":"internal","maxSize":"16M","numThreads":8},\ -{"name":"medium","type":"internal","maxSize":"128M","numThreads":4},\ -{"name":"large","type":"internal","numThreads":2}] - +test.ci.common.accumulo.server.props= # Accumulo table properties to set when creating table -test.ci.common.accumulo.table.props=\ -table.compaction.dispatcher=org.apache.accumulo.core.spi.compaction.SimpleCompactionDispatcher \ -table.compaction.dispatcher.opts.service=cs1 - +test.ci.common.accumulo.table.props= # Ingest # ------ # Number of entries each ingest client should write diff --git a/src/main/java/org/apache/accumulo/testing/continuous/ContinuousWalk.java b/src/main/java/org/apache/accumulo/testing/continuous/ContinuousWalk.java index 94a53bb1..0dc13f59 100644 --- a/src/main/java/org/apache/accumulo/testing/continuous/ContinuousWalk.java +++ b/src/main/java/org/apache/accumulo/testing/continuous/ContinuousWalk.java @@ -46,6 +46,9 @@ static class BadChecksumException extends RuntimeException { super(msg); } + public BadChecksumException(String msg, Exception nfe) { + super(msg, nfe); + } } public static void main(String[] args) throws Exception { @@ -154,7 +157,7 @@ private static String getPrevRow(Value value) { return null; } - private static int getChecksumOffset(byte[] val) { + static int getChecksumOffset(byte[] val) { if (val[val.length - 1] != ':') { if (val[val.length - 9] != ':') throw new IllegalArgumentException(new String(val, UTF_8)); @@ -169,7 +172,12 @@ static void validate(Key key, Value value) throws BadChecksumException { if (ckOff < 0) return; - long storedCksum = Long.parseLong(new String(value.get(), ckOff, 8, UTF_8), 16); + long storedCksum; + try { + storedCksum = Long.parseLong(new String(value.get(), ckOff, 8, UTF_8), 16); + } catch (NumberFormatException nfe) { + throw new BadChecksumException("Checksum invalid " + key + " " + value, nfe); + } CRC32 cksum = new CRC32(); diff --git a/src/main/java/org/apache/accumulo/testing/continuous/CorruptEntry.java b/src/main/java/org/apache/accumulo/testing/continuous/CorruptEntry.java new file mode 100644 index 00000000..7fc6b998 --- /dev/null +++ b/src/main/java/org/apache/accumulo/testing/continuous/CorruptEntry.java @@ -0,0 +1,69 @@ +/* + * Licensed to the Apache Software Foundation (ASF) under one + * or more contributor license agreements. See the NOTICE file + * distributed with this work for additional information + * regarding copyright ownership. The ASF licenses this file + * to you under the Apache License, Version 2.0 (the + * "License"); you may not use this file except in compliance + * with the License. You may obtain a copy of the License at + * + * https://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, + * software distributed under the License is distributed on an + * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY + * KIND, either express or implied. See the License for the + * specific language governing permissions and limitations + * under the License. + */ +package org.apache.accumulo.testing.continuous; + +import static java.nio.charset.StandardCharsets.UTF_8; + +import org.apache.accumulo.core.client.AccumuloClient; +import org.apache.accumulo.core.data.Key; +import org.apache.accumulo.core.data.Mutation; +import org.apache.accumulo.core.data.Range; +import org.apache.hadoop.io.Text; + +public class CorruptEntry { + public static void main(String[] args) throws Exception { + try (ContinuousEnv env = new ContinuousEnv(args); + AccumuloClient client = env.getAccumuloClient(); + var scanner = client.createScanner(env.getAccumuloTableName()); + var writer = client.createBatchWriter(env.getAccumuloTableName())) { + final long rowMin = env.getRowMin(); + + var startRow = ContinuousIngest.genRow(rowMin); + new Range(new Text(startRow), null); + scanner.setRange(new Range(new Text(startRow), null)); + var iter = scanner.iterator(); + if (iter.hasNext()) { + var entry = iter.next(); + byte[] val = entry.getValue().get(); + int offset = ContinuousWalk.getChecksumOffset(val); + if (offset >= 0) { + for (int i = 0; i < 8; i++) { + if (val[i + offset] == 'f' || val[i + offset] == 'F') { + // in the case of an f hex char, set the hex char to 0 + val[i + offset] = '0'; + + } else { + // increment the hex char in the checcksum + val[i + offset]++; + } + } + Key key = entry.getKey(); + Mutation m = new Mutation(key.getRow()); + m.at().family(key.getColumnFamily()).qualifier(key.getColumnQualifier()) + .visibility(key.getColumnVisibility()).put(val); + writer.addMutation(m); + writer.flush(); + System.out.println("Corrupted checksum value on key " + key); + } + } else { + System.out.println("No entry found after " + new String(startRow, UTF_8)); + } + } + } +} diff --git a/src/main/java/org/apache/accumulo/testing/continuous/FlakyBulkBatchWriter.java b/src/main/java/org/apache/accumulo/testing/continuous/FlakyBulkBatchWriter.java index 281b1834..9259fa02 100644 --- a/src/main/java/org/apache/accumulo/testing/continuous/FlakyBulkBatchWriter.java +++ b/src/main/java/org/apache/accumulo/testing/continuous/FlakyBulkBatchWriter.java @@ -187,7 +187,7 @@ public synchronized void flush() throws MutationsRejectedException { long t2 = System.nanoTime(); log.debug("Bulk imported dir {} destinations:{} mutations:{} memUsed:{} time:{}ms", tmpDir, - loadPlan.getDestinations().size(), mutations.size(), memUsed, + loadPlan.getDestinations().size(), keysValues.size(), memUsed, TimeUnit.NANOSECONDS.toMillis(t2 - t1)); fileSystem.delete(tmpDir, true); diff --git a/src/main/java/org/apache/accumulo/testing/continuous/ValidatingIterator.java b/src/main/java/org/apache/accumulo/testing/continuous/ValidatingIterator.java new file mode 100644 index 00000000..500e7a5c --- /dev/null +++ b/src/main/java/org/apache/accumulo/testing/continuous/ValidatingIterator.java @@ -0,0 +1,47 @@ +/* + * Licensed to the Apache Software Foundation (ASF) under one + * or more contributor license agreements. See the NOTICE file + * distributed with this work for additional information + * regarding copyright ownership. The ASF licenses this file + * to you under the Apache License, Version 2.0 (the + * "License"); you may not use this file except in compliance + * with the License. You may obtain a copy of the License at + * + * https://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, + * software distributed under the License is distributed on an + * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY + * KIND, either express or implied. See the License for the + * specific language governing permissions and limitations + * under the License. + */ +package org.apache.accumulo.testing.continuous; + +import java.io.IOException; +import java.util.Collection; + +import org.apache.accumulo.core.data.ByteSequence; +import org.apache.accumulo.core.data.Range; +import org.apache.accumulo.core.iterators.WrappingIterator; + +/** + * Validate the checksum on each entry read in the continuous ingest table + */ +public class ValidatingIterator extends WrappingIterator { + + public void seek(Range range, Collection columnFamilies, boolean inclusive) + throws IOException { + super.seek(range, columnFamilies, inclusive); + if (super.hasTop()) { + ContinuousWalk.validate(super.getTopKey(), super.getTopValue()); + } + } + + public void next() throws IOException { + super.next(); + if (super.hasTop()) { + ContinuousWalk.validate(super.getTopKey(), super.getTopValue()); + } + } +} diff --git a/test/compation-failures/README.md b/test/compation-failures/README.md new file mode 100644 index 00000000..b11e334c --- /dev/null +++ b/test/compation-failures/README.md @@ -0,0 +1,15 @@ + +Some scripts for testing different compaction failure scenarios. + +```bash +# start compactors, half of which will always fail any compaction because they are missing an iterator class +./setup-compactors.sh +# starting ingest into table ci1 +./start-ingest.sh ci1 NORMAL +# starting ingest into table ci2 with a non-existent compaction iterator configured, all compactions should fail on this table +./start-ingest.sh ci2 BAD_ITER +# starting ingest into table ci3 with a compaction service that has no compactors running, no compactions should ever run for this table +./start-ingest.sh ci3 BAD_SERVICE +# starting ingest into table ci4, corrupting data in a single tablet such that that tablet can never compact +./start-ingest.sh ci4 BAD_TABLET +``` \ No newline at end of file diff --git a/test/compation-failures/setup-compactors.sh b/test/compation-failures/setup-compactors.sh new file mode 100755 index 00000000..8c28ae3f --- /dev/null +++ b/test/compation-failures/setup-compactors.sh @@ -0,0 +1,60 @@ +#!/bin/bash +# +# Licensed to the Apache Software Foundation (ASF) under one +# or more contributor license agreements. See the NOTICE file +# distributed with this work for additional information +# regarding copyright ownership. The ASF licenses this file +# to you under the Apache License, Version 2.0 (the +# "License"); you may not use this file except in compliance +# with the License. You may obtain a copy of the License at +# +# https://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, +# software distributed under the License is distributed on an +# "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY +# KIND, either express or implied. See the License for the +# specific language governing permissions and limitations +# under the License. +# + + +# configure compaction services +accumulo shell -u root -p secret < logs/coord.out & + +# get the absolute path of the the accumulo test non shaded test jar +TEST_JAR=$(readlink -f $(ls ../../target/accumulo-testing-[0-9].*jar)) + +# start 4 compactors with the test iterator on their classpath +for i in $(seq 1 4); do + CLASSPATH=$TEST_JAR ACCUMULO_SERVICE_INSTANCE=compactor_small_$i accumulo compactor -q small &> logs/compactor-small-$i.out & +done + +# start four compactors that do not have the test jar on their classpath. Since +# every table configures an iterator w/ the test jar, every compaction on these +# compactors should fail +for i in $(seq 5 8); do + ACCUMULO_SERVICE_INSTANCE=compactor_small_$i accumulo compactor -q small &> logs/compactor-small-$i.out & +done + +# start 4 compactors for the large group w/ the test iterator on the classpath +for i in $(seq 1 4); do + CLASSPATH=$TEST_JAR ACCUMULO_SERVICE_INSTANCE=compactor_large_$i accumulo compactor -q large &> logs/compactor-large-$i.out & +done + +# start 4 compactors for the large group that are missing the iterator used by the test table +for i in $(seq 5 8); do + ACCUMULO_SERVICE_INSTANCE=compactor_large_$i accumulo compactor -q large &> logs/compactor-large-$i.out & +done \ No newline at end of file diff --git a/test/compation-failures/start-ingest.sh b/test/compation-failures/start-ingest.sh new file mode 100755 index 00000000..ce188191 --- /dev/null +++ b/test/compation-failures/start-ingest.sh @@ -0,0 +1,72 @@ +#!/bin/bash +# +# Licensed to the Apache Software Foundation (ASF) under one +# or more contributor license agreements. See the NOTICE file +# distributed with this work for additional information +# regarding copyright ownership. The ASF licenses this file +# to you under the Apache License, Version 2.0 (the +# "License"); you may not use this file except in compliance +# with the License. You may obtain a copy of the License at +# +# https://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, +# software distributed under the License is distributed on an +# "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY +# KIND, either express or implied. See the License for the +# specific language governing permissions and limitations +# under the License. +# + + +if [ "$#" != "2" ]; then + echo "Usage $0 BAD_ITER|BAD_TABLET|BAD_SERVICE|NORMAL" + exit 1 +fi + +#accumulo-testing directory +ATD=../.. + +table=$1 +test_type=$2 + +$ATD/bin/cingest createtable -o test.ci.common.accumulo.table=$table + +# setup a compaction time iterator and point the tablet to compaction service w/ external compactors +accumulo shell -u root -p secret < BAD_ITER|BAD_TABLET|BAD_SERVICE|NORMAL" + exit 1 +esac + +mkdir -p logs + +if [ "$test_type" == "NORMAL" ]; then + # start unlimited ingest into the table + $ATD/bin/cingest ingest -o test.ci.ingest.bulk.workdir=/ci_bulk -o test.ci.ingest.max.tablets=3 -o test.ci.common.accumulo.table=$table -o test.ci.ingest.bulk.memory.limit=32000000 &> logs/bulk-$table.log & +else + # limit the amount of data written since tablets can not compact + # would not need to do this if the table.file.pause property existed in 2.1 + $ATD/bin/cingest ingest -o test.ci.ingest.bulk.workdir=/ci_bulk -o test.ci.ingest.max.tablets=3 -o test.ci.common.accumulo.table=$table -o test.ci.ingest.bulk.memory.limit=32000000 -o test.ci.ingest.client.entries=10000000 &> logs/bulk-$table.log & +fi From 63c5c429090e425fae0fa174b0f13dfa8a8ec0f2 Mon Sep 17 00:00:00 2001 From: Keith Turner Date: Mon, 14 Jul 2025 22:34:47 +0000 Subject: [PATCH 2/6] added TODO --- test/compation-failures/start-ingest.sh | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/test/compation-failures/start-ingest.sh b/test/compation-failures/start-ingest.sh index ce188191..4ae728b7 100755 --- a/test/compation-failures/start-ingest.sh +++ b/test/compation-failures/start-ingest.sh @@ -70,3 +70,8 @@ else # would not need to do this if the table.file.pause property existed in 2.1 $ATD/bin/cingest ingest -o test.ci.ingest.bulk.workdir=/ci_bulk -o test.ci.ingest.max.tablets=3 -o test.ci.common.accumulo.table=$table -o test.ci.ingest.bulk.memory.limit=32000000 -o test.ci.ingest.client.entries=10000000 &> logs/bulk-$table.log & fi + +# TODO for the BAD_TABLET case start two ingesters. One that writes to the +# entire tablet including the bad tablet. Another that writes only the part of +# the table that does not include the bad tablet. The one writing to only good +# tablets should be able to ingest and compact w/o issue. From 2e3d21f56fb7160ed7f7e7383c3f475403250f1f Mon Sep 17 00:00:00 2001 From: Keith Turner Date: Tue, 15 Jul 2025 22:32:17 +0000 Subject: [PATCH 3/6] WIP adjusted scripts based on using them --- conf/accumulo-testing.properties | 6 ++-- test/compation-failures/README.md | 20 +++++++++++- .../count-file-per-tablet.jshell | 31 +++++++++++++++++++ test/compation-failures/start-ingest.sh | 4 +-- 4 files changed, 55 insertions(+), 6 deletions(-) create mode 100644 test/compation-failures/count-file-per-tablet.jshell diff --git a/conf/accumulo-testing.properties b/conf/accumulo-testing.properties index b22af96f..3843f3af 100644 --- a/conf/accumulo-testing.properties +++ b/conf/accumulo-testing.properties @@ -39,7 +39,7 @@ test.common.yarn.container.cores=1 # Accumulo table used by continuous tests test.ci.common.accumulo.table=ci # Number of tablets that should exist in Accumulo table when created -test.ci.common.accumulo.num.tablets=20 +test.ci.common.accumulo.num.tablets=100 # Optional authorizations that if specified will be randomly selected by scanners and walkers # Format: a,b|a,b,c|c test.ci.common.auths= @@ -64,7 +64,7 @@ test.ci.ingest.max.cq=32767 # Maximum number of tablets that will be written to for a single flush. For each iteration of flush the tablets to # write to are randomly chosen. When this is set to Integer.MAX_VALUE no limiting is done. This must be set to # a number in the range [2,Integer.MAX_VALUE]. -test.ci.ingest.max.tablets=2147483647 +test.ci.ingest.max.tablets=20 # Optional visibilities (in CSV format) that if specified will be randomly selected by ingesters for # each linked list test.ci.ingest.visibilities= @@ -96,7 +96,7 @@ test.ci.ingest.zipfian.exponent=1.5 test.ci.ingest.bulk.workdir= # When using bulk import to ingest data this determines how much memory can be used to buffer mutations before creating # rfiles and importing them. -test.ci.ingest.bulk.memory.limit=512000000 +test.ci.ingest.bulk.memory.limit=64000000 # Batch walker # ------------ diff --git a/test/compation-failures/README.md b/test/compation-failures/README.md index b11e334c..9d99117c 100644 --- a/test/compation-failures/README.md +++ b/test/compation-failures/README.md @@ -12,4 +12,22 @@ Some scripts for testing different compaction failure scenarios. ./start-ingest.sh ci3 BAD_SERVICE # starting ingest into table ci4, corrupting data in a single tablet such that that tablet can never compact ./start-ingest.sh ci4 BAD_TABLET -``` \ No newline at end of file +``` + +While test are running can use the following to monitor files per tablet on a table. + +``` +$ accumulo jshell +Preparing JShell for Apache Accumulo + +Use 'client' to interact with Accumulo + +| Welcome to JShell -- Version 17.0.15 +| For an introduction type: /help intro + +jshell> /open count-file-per-tablet.jshell + +jshell> CFPT.printStats(client, "ci1", 3000) + 0 secs min:20 avg:30.37 max:35 + 3 secs min:20 avg:30.28 max:35 +``` diff --git a/test/compation-failures/count-file-per-tablet.jshell b/test/compation-failures/count-file-per-tablet.jshell new file mode 100644 index 00000000..b6f385a9 --- /dev/null +++ b/test/compation-failures/count-file-per-tablet.jshell @@ -0,0 +1,31 @@ +import com.google.common.collect.Iterators; +import com.google.common.collect.Streams; +import org.apache.accumulo.core.client.AccumuloClient; +import org.apache.accumulo.core.client.RowIterator; +import org.apache.accumulo.core.data.Range; + +// counts files per tablet for a table over time +public class CFPT { + + public static void printPerTabletFileStats(AccumuloClient client, String table, long startTime) throws Exception { + var tableId = client.tableOperations().tableIdMap().get(table); + try(var scanner = client.createScanner("accumulo.metadata")) { + scanner.setRange(new Range(tableId+":", tableId+"<")); + scanner.fetchColumnFamily("file"); + RowIterator rowIterator = new RowIterator(scanner); + var stats = Streams.stream(rowIterator).mapToInt(Iterators::size).summaryStatistics(); + long diff = (System.currentTimeMillis() -startTime)/1000; + System.out.printf("%3d secs min:%d avg:%.2f max:%d\n", diff, stats.getMin(),stats.getAverage(),stats.getMax() ); + } + } + + public static void printStats(AccumuloClient client, String table, long sleep) throws Exception { + long startTime = System.currentTimeMillis(); + printPerTabletFileStats(client, table, startTime); + + while(true) { + Thread.sleep(sleep); + printPerTabletFileStats(client, table, startTime); + } + } +} diff --git a/test/compation-failures/start-ingest.sh b/test/compation-failures/start-ingest.sh index 4ae728b7..0fe347f3 100755 --- a/test/compation-failures/start-ingest.sh +++ b/test/compation-failures/start-ingest.sh @@ -64,11 +64,11 @@ mkdir -p logs if [ "$test_type" == "NORMAL" ]; then # start unlimited ingest into the table - $ATD/bin/cingest ingest -o test.ci.ingest.bulk.workdir=/ci_bulk -o test.ci.ingest.max.tablets=3 -o test.ci.common.accumulo.table=$table -o test.ci.ingest.bulk.memory.limit=32000000 &> logs/bulk-$table.log & + $ATD/bin/cingest ingest -o test.ci.ingest.bulk.workdir=/ci_bulk -o test.ci.common.accumulo.table=$table &> logs/bulk-$table.log & else # limit the amount of data written since tablets can not compact # would not need to do this if the table.file.pause property existed in 2.1 - $ATD/bin/cingest ingest -o test.ci.ingest.bulk.workdir=/ci_bulk -o test.ci.ingest.max.tablets=3 -o test.ci.common.accumulo.table=$table -o test.ci.ingest.bulk.memory.limit=32000000 -o test.ci.ingest.client.entries=10000000 &> logs/bulk-$table.log & + $ATD/bin/cingest ingest -o test.ci.ingest.bulk.workdir=/ci_bulk -o test.ci.common.accumulo.table=$table -o test.ci.ingest.client.entries=10000000 &> logs/bulk-$table.log & fi # TODO for the BAD_TABLET case start two ingesters. One that writes to the From 88267a9dc81ffab82c515c8bf079d2416e8ef226 Mon Sep 17 00:00:00 2001 From: Keith Turner Date: Tue, 15 Jul 2025 22:50:43 +0000 Subject: [PATCH 4/6] rename dir --- test/{compation-failures => compaction-failures}/README.md | 0 .../count-file-per-tablet.jshell | 0 .../setup-compactors.sh | 0 test/{compation-failures => compaction-failures}/start-ingest.sh | 0 4 files changed, 0 insertions(+), 0 deletions(-) rename test/{compation-failures => compaction-failures}/README.md (100%) rename test/{compation-failures => compaction-failures}/count-file-per-tablet.jshell (100%) rename test/{compation-failures => compaction-failures}/setup-compactors.sh (100%) rename test/{compation-failures => compaction-failures}/start-ingest.sh (100%) diff --git a/test/compation-failures/README.md b/test/compaction-failures/README.md similarity index 100% rename from test/compation-failures/README.md rename to test/compaction-failures/README.md diff --git a/test/compation-failures/count-file-per-tablet.jshell b/test/compaction-failures/count-file-per-tablet.jshell similarity index 100% rename from test/compation-failures/count-file-per-tablet.jshell rename to test/compaction-failures/count-file-per-tablet.jshell diff --git a/test/compation-failures/setup-compactors.sh b/test/compaction-failures/setup-compactors.sh similarity index 100% rename from test/compation-failures/setup-compactors.sh rename to test/compaction-failures/setup-compactors.sh diff --git a/test/compation-failures/start-ingest.sh b/test/compaction-failures/start-ingest.sh similarity index 100% rename from test/compation-failures/start-ingest.sh rename to test/compaction-failures/start-ingest.sh From b4c273cc0745c95b7a72cac1b3d1d11c4d0c173c Mon Sep 17 00:00:00 2001 From: Keith Turner Date: Wed, 16 Jul 2025 14:35:38 +0000 Subject: [PATCH 5/6] code review updates --- conf/accumulo-testing.properties | 19 ++++++++++++++----- .../testing/continuous/CorruptEntry.java | 2 +- test/compaction-failures/start-ingest.sh | 4 ---- 3 files changed, 15 insertions(+), 10 deletions(-) diff --git a/conf/accumulo-testing.properties b/conf/accumulo-testing.properties index 3843f3af..7e4bc911 100644 --- a/conf/accumulo-testing.properties +++ b/conf/accumulo-testing.properties @@ -39,14 +39,23 @@ test.common.yarn.container.cores=1 # Accumulo table used by continuous tests test.ci.common.accumulo.table=ci # Number of tablets that should exist in Accumulo table when created -test.ci.common.accumulo.num.tablets=100 +test.ci.common.accumulo.num.tablets=20 # Optional authorizations that if specified will be randomly selected by scanners and walkers # Format: a,b|a,b,c|c test.ci.common.auths= # Accumulo tserver properties to set when creating a table -test.ci.common.accumulo.server.props= +test.ci.common.accumulo.server.props=\ +tserver.compaction.major.service.cs1.planner=org.apache.accumulo.core.spi.compaction.DefaultCompactionPlanner \ +tserver.compaction.major.service.cs1.planner.opts.executors=\ +[{"name":"small","type":"internal","maxSize":"16M","numThreads":8},\ +{"name":"medium","type":"internal","maxSize":"128M","numThreads":4},\ +{"name":"large","type":"internal","numThreads":2}] + # Accumulo table properties to set when creating table -test.ci.common.accumulo.table.props= +test.ci.common.accumulo.table.props=\ +table.compaction.dispatcher=org.apache.accumulo.core.spi.compaction.SimpleCompactionDispatcher \ +table.compaction.dispatcher.opts.service=cs1 + # Ingest # ------ # Number of entries each ingest client should write @@ -64,7 +73,7 @@ test.ci.ingest.max.cq=32767 # Maximum number of tablets that will be written to for a single flush. For each iteration of flush the tablets to # write to are randomly chosen. When this is set to Integer.MAX_VALUE no limiting is done. This must be set to # a number in the range [2,Integer.MAX_VALUE]. -test.ci.ingest.max.tablets=20 +test.ci.ingest.max.tablets=2147483647 # Optional visibilities (in CSV format) that if specified will be randomly selected by ingesters for # each linked list test.ci.ingest.visibilities= @@ -96,7 +105,7 @@ test.ci.ingest.zipfian.exponent=1.5 test.ci.ingest.bulk.workdir= # When using bulk import to ingest data this determines how much memory can be used to buffer mutations before creating # rfiles and importing them. -test.ci.ingest.bulk.memory.limit=64000000 +test.ci.ingest.bulk.memory.limit=512000000 # Batch walker # ------------ diff --git a/src/main/java/org/apache/accumulo/testing/continuous/CorruptEntry.java b/src/main/java/org/apache/accumulo/testing/continuous/CorruptEntry.java index 7fc6b998..bd71fa12 100644 --- a/src/main/java/org/apache/accumulo/testing/continuous/CorruptEntry.java +++ b/src/main/java/org/apache/accumulo/testing/continuous/CorruptEntry.java @@ -62,7 +62,7 @@ public static void main(String[] args) throws Exception { System.out.println("Corrupted checksum value on key " + key); } } else { - System.out.println("No entry found after " + new String(startRow, UTF_8)); + throw new IllegalArgumentException("No entry found after " + new String(startRow, UTF_8)); } } } diff --git a/test/compaction-failures/start-ingest.sh b/test/compaction-failures/start-ingest.sh index 0fe347f3..9bebfb67 100755 --- a/test/compaction-failures/start-ingest.sh +++ b/test/compaction-failures/start-ingest.sh @@ -71,7 +71,3 @@ else $ATD/bin/cingest ingest -o test.ci.ingest.bulk.workdir=/ci_bulk -o test.ci.common.accumulo.table=$table -o test.ci.ingest.client.entries=10000000 &> logs/bulk-$table.log & fi -# TODO for the BAD_TABLET case start two ingesters. One that writes to the -# entire tablet including the bad tablet. Another that writes only the part of -# the table that does not include the bad tablet. The one writing to only good -# tablets should be able to ingest and compact w/o issue. From 9f2c494125d86a8da0be0875a7692e286a07329d Mon Sep 17 00:00:00 2001 From: Keith Turner Date: Wed, 16 Jul 2025 14:50:40 +0000 Subject: [PATCH 6/6] fix build --- test/compaction-failures/README.md | 20 +++++++++++++++++++ .../count-file-per-tablet.jshell | 19 ++++++++++++++++++ 2 files changed, 39 insertions(+) diff --git a/test/compaction-failures/README.md b/test/compaction-failures/README.md index 9d99117c..1b48b295 100644 --- a/test/compaction-failures/README.md +++ b/test/compaction-failures/README.md @@ -1,3 +1,23 @@ + Some scripts for testing different compaction failure scenarios. diff --git a/test/compaction-failures/count-file-per-tablet.jshell b/test/compaction-failures/count-file-per-tablet.jshell index b6f385a9..5f3cf40c 100644 --- a/test/compaction-failures/count-file-per-tablet.jshell +++ b/test/compaction-failures/count-file-per-tablet.jshell @@ -1,3 +1,22 @@ +/* + * Licensed to the Apache Software Foundation (ASF) under one + * or more contributor license agreements. See the NOTICE file + * distributed with this work for additional information + * regarding copyright ownership. The ASF licenses this file + * to you under the Apache License, Version 2.0 (the + * "License"); you may not use this file except in compliance + * with the License. You may obtain a copy of the License at + * + * https://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, + * software distributed under the License is distributed on an + * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY + * KIND, either express or implied. See the License for the + * specific language governing permissions and limitations + * under the License. + */ + import com.google.common.collect.Iterators; import com.google.common.collect.Streams; import org.apache.accumulo.core.client.AccumuloClient;