dlmarion commented on code in PR #3555:
URL: https://github.com/apache/accumulo/pull/3555#discussion_r1251059616


##########
test/src/main/java/org/apache/accumulo/test/functional/CompactionIT.java:
##########
@@ -280,6 +283,28 @@ public void testUserCompactionCancellation() throws 
Exception {
     }
   }
 
+  @Test
+  public void testErrorDuringUserCompaction() throws Exception {
+    final String table1 = this.getUniqueNames(1)[0];
+    try (AccumuloClient client = 
Accumulo.newClient().from(getClientProps()).build()) {
+      client.tableOperations().create(table1);
+      try (BatchWriter bw = client.createBatchWriter(table1)) {
+        for (int i = 1; i <= MAX_DATA; i++) {
+          Mutation m = new Mutation(Integer.toString(i));
+          m.put("cf", "cq", new Value());
+          bw.addMutation(m);
+          bw.flush();
+          // flush often to create multiple files to compact
+          client.tableOperations().flush(table1, null, null, true);
+        }
+      }
+      IteratorSetting setting = new IteratorSetting(50, "error", 
ErrorThrowingIterator.class);
+      setting.addOption(ErrorThrowingIterator.TIMES, "3");
+      client.tableOperations().attachIterator(table1, setting, 
EnumSet.of(IteratorScope.majc));
+      client.tableOperations().compact(table1, new 
CompactionConfig().setWait(true));

Review Comment:
   Modified CompactionIT in 8d3072d . I modified this test method to read the 
data after compaction and confirm the number of files. I added an additional 
test that completes a compaction with no resulting data and confirms that there 
is no file in the tablet metadata.



-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: [email protected]

For queries about this service, please contact Infrastructure at:
[email protected]

Reply via email to