You are viewing a plain text version of this content. The canonical link for it is here.
Posted to notifications@accumulo.apache.org by "ArbaazKhan1 (via GitHub)" <gi...@apache.org> on 2024/04/16 21:35:15 UTC

[PR] Accumulo 3986 [accumulo]

ArbaazKhan1 opened a new pull request, #4465:
URL: https://github.com/apache/accumulo/pull/4465

   Added command option `FindCompactionTmpFIles` to admin commands. 
   
   closes [issue #3986 ](https://github.com/apache/accumulo/issues/3986)


-- 
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: notifications-unsubscribe@accumulo.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org


Re: [PR] Run FindCompactionTmpFiles utility via accumulo Admin [accumulo]

Posted by "dlmarion (via GitHub)" <gi...@apache.org>.
dlmarion commented on code in PR #4465:
URL: https://github.com/apache/accumulo/pull/4465#discussion_r1568742637


##########
server/base/src/main/java/org/apache/accumulo/server/util/Admin.java:
##########
@@ -106,6 +106,15 @@ static class AdminOpts extends ServerUtilOpts {
     boolean force = false;
   }
 
+  @Parameters(commandDescription = "Compaction Temp Files Utility")
+  static class FindCompactionTmpFilesCommand {

Review Comment:
   I wonder if you could just reuse FindCompactionTmpFiles.Opts. If you did this, then you could refactor FindCompactionTmpFiles.main and move most of the logic to a new method `FindCompactionTmpFiles.execute(Opts)`.



-- 
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: notifications-unsubscribe@accumulo.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org


Re: [PR] Run FindCompactionTmpFiles utility via accumulo Admin [accumulo]

Posted by "kevinrr888 (via GitHub)" <gi...@apache.org>.
kevinrr888 commented on code in PR #4465:
URL: https://github.com/apache/accumulo/pull/4465#discussion_r2754792070


##########
server/base/src/main/java/org/apache/accumulo/server/util/FindCompactionTmpFiles.java:
##########


Review Comment:
   ```suggestion
   ```
   Logged again in execute()



##########
test/src/main/java/org/apache/accumulo/test/functional/FindCompactionTmpFilesIT_SimpleSuite.java:
##########
@@ -216,4 +218,57 @@ public void testFindCompactionTmpFilesMainWithDelete() throws Exception {
     }
   }
 
+  @Test
+  public void testFindCompactionTmpFilesAdminCommand() throws Exception {
+
+    try (AccumuloClient c = Accumulo.newClient().from(getClientProps()).build()) {
+
+      String tableName = getUniqueNames(1)[0];
+      c.tableOperations().create(tableName);
+      ReadWriteIT.ingest(c, 100, 1, 1, 0, tableName);
+      c.tableOperations().flush(tableName);
+
+      String tableId = c.tableOperations().tableIdMap().get(tableName);
+      TableId tid = TableId.of(tableId);
+
+      ServerContext ctx = getCluster().getServerContext();
+      FileSystem fs = getCluster().getFileSystem();
+
+      Set<String> tablesDirs = ctx.getTablesDirs();
+      assertEquals(1, tablesDirs.size());
+
+      String tdir = tablesDirs.iterator().next() + "/" + tid.canonical() + "/default_tablet";
+      Path defaultTabletPath = new Path(tdir);
+      assertTrue(fs.exists(defaultTabletPath));
+
+      Set<Path> generatedPaths = generateTmpFilePaths(ctx, tid, defaultTabletPath, 100);
+      for (Path p : generatedPaths) {
+        assertFalse(fs.exists(p));
+        assertTrue(fs.createNewFile(p));
+        assertTrue(fs.exists(p));
+      }
+
+      Set<Path> foundPaths = FindCompactionTmpFiles.findTempFiles(ctx, tid.canonical());
+      assertEquals(100, foundPaths.size());
+      assertEquals(foundPaths, generatedPaths);
+
+      System.setProperty("accumulo.properties",
+          "file://" + getCluster().getAccumuloPropertiesPath());
+      assertEquals(0, getCluster().exec(Admin.class, "compactionTempFiles", "-t", tableName)
+          .getProcess().waitFor());
+
+      foundPaths = FindCompactionTmpFiles.findTempFiles(ctx, tid.canonical());
+      assertEquals(100, foundPaths.size());
+      assertEquals(foundPaths, generatedPaths);
+
+      assertEquals(0, getCluster().exec(Admin.class, "compactionTempFiles", "-t", tableName, "-d")
+          .getProcess().waitFor());

Review Comment:
   These command executions should have their output validated. The first should output something like "Found the following compaction tmp files..." followed by each of the 100 temp files. The second should output something like "Removed old temp file ..." for each of the files deleted. See something like FateOpsCommandsITBase for an example of verifying output of a command.
   
   Also wondering if 100 files here is overkill. If the test runs significantly faster with less files, I think that should be changed as well. The number of files doesn't really matter so less would be good if it speeds the test up.



-- 
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: notifications-unsubscribe@accumulo.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org


Re: [PR] Run FindCompactionTmpFiles utility via accumulo Admin [accumulo]

Posted by "EdColeman (via GitHub)" <gi...@apache.org>.
EdColeman commented on PR #4465:
URL: https://github.com/apache/accumulo/pull/4465#issuecomment-2064450690

   Should there be a check to see if the system is up or if there running compactions?  If this was run on a system with active compactions, would it find and delete files that were currently being written to be the compaction process?
   
   As a stand-alone utility it is a little harder to run the command - if elevated to an admin utility, would that increase the chances that it would be run on an active system?
   


-- 
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: notifications-unsubscribe@accumulo.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org


Re: [PR] Run FindCompactionTmpFiles utility via accumulo Admin [accumulo]

Posted by "ctubbsii (via GitHub)" <gi...@apache.org>.
ctubbsii commented on PR #4465:
URL: https://github.com/apache/accumulo/pull/4465#issuecomment-2329365929

   May want to wait on merging this until after #4807 is merged, because I suspect there will be conflicts, or at least some related changes.


-- 
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: notifications-unsubscribe@accumulo.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org


Re: [PR] Run FindCompactionTmpFiles utility via accumulo Admin [accumulo]

Posted by "dlmarion (via GitHub)" <gi...@apache.org>.
dlmarion merged PR #4465:
URL: https://github.com/apache/accumulo/pull/4465


-- 
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: notifications-unsubscribe@accumulo.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org


Re: [PR] Run FindCompactionTmpFiles utility via accumulo Admin [accumulo]

Posted by "kevinrr888 (via GitHub)" <gi...@apache.org>.
kevinrr888 commented on PR #4465:
URL: https://github.com/apache/accumulo/pull/4465#issuecomment-2754586265

   Any update on this? Think it just needs an IT


-- 
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: notifications-unsubscribe@accumulo.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org


Re: [PR] Run FindCompactionTmpFiles utility via accumulo Admin [accumulo]

Posted by "dlmarion (via GitHub)" <gi...@apache.org>.
dlmarion commented on PR #4465:
URL: https://github.com/apache/accumulo/pull/4465#issuecomment-2066437985

   > Should there be a check to see if the system is up or if there running compactions? If this was run on a system with active compactions, would it find and delete files that were currently being written to be the compaction process?
   > 
   > As a stand-alone utility it is a little harder to run the command - if elevated to an admin utility, would that increase the chances that it would be run on an active system?
   
   FindCompactionTmpFiles first finds the tmp files, then removes from that set any file that is referenced from currently executing compactions.


-- 
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: notifications-unsubscribe@accumulo.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org