-
Notifications
You must be signed in to change notification settings - Fork 478
Wrap undo in try block #1759
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Wrap undo in try block #1759
Conversation
|
Should I catch the Exception as well? I noticed on other spots that we didn't so I wasn't sure. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This is good, but there's a similar issue in the ChooseDir undo method, where it doesn't first check that the tableInfo.getInitialSplitSize() > 0, which means it can get an NPE. It might be good to make that change as part of this PR also, if you're okay with that, @Manno15 .
There's also a similar issue in FinishCreateTable.cleanupSplitFiles, which can cause the table creation to fail, even if the table was, in fact, created. Perhaps it'd be better to just log that error, instead of failing and rolling back the entire table creation? I'm not sure. What do you think, @keith-turner ?
Logging an error in that case does seem better. |
@Manno15 based on the comment by @ctubbsii I am thinking maybe in all of the places where this file is deleted that if it fails the exception should be caught and an error or warning logged. So an exception is not thrown out of the operation if delete fails. |
|
I'll add the requested changes. |
|
server/manager/src/main/java/org/apache/accumulo/master/tableOps/create/ChooseDir.java
Outdated
Show resolved
Hide resolved
server/manager/src/main/java/org/apache/accumulo/master/tableOps/create/CreateTable.java
Outdated
Show resolved
Hide resolved
server/manager/src/main/java/org/apache/accumulo/master/tableOps/create/FinishCreateTable.java
Show resolved
Hide resolved
ctubbsii
left a comment
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Thanks @Manno15 . This looks good to me. Since you're a committer now, you should be able to merge it yourself. I recommend merging from the GitHub UI in the pull request. You should use the "Squash and merge" option from the dropdown, and clean up your log message as part of the process. Let me know if you have questions.
In response to comment from @keith-turner. I added a try block around my previous change on #1746. With the unreserveNamespace call in the finally block.