You are viewing a plain text version of this content. The canonical link for it is here.
Posted to notifications@accumulo.apache.org by GitBox <gi...@apache.org> on 2020/10/30 00:36:37 UTC

[GitHub] [accumulo] ctubbsii commented on a change in pull request #1746: Close #1739. Cleanup Splits file if CreateTable FaTE operation fails.

ctubbsii commented on a change in pull request #1746:
URL: https://github.com/apache/accumulo/pull/1746#discussion_r514643474



##########
File path: server/manager/src/main/java/org/apache/accumulo/master/tableOps/create/CreateTable.java
##########
@@ -78,7 +80,13 @@ public long isReady(long tid, Master environment) throws Exception {
   }
 
   @Override
-  public void undo(long tid, Master env) {
+  public void undo(long tid, Master env) throws IOException {
+    // Clean up split files if create table operation fails
+    if(tableInfo.getInitialSplitSize() > 0) {
+      Path p = tableInfo.getSplitPath().getParent();
+      FileSystem fs = p.getFileSystem(env.getContext().getHadoopConf());
+      fs.delete(p, true);

Review comment:
       We could wrap this and put the unreserve call in the finally block.




----------------------------------------------------------------
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.

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