-
Notifications
You must be signed in to change notification settings - Fork 24
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
Rollback changes in case of unsucessful apply stage #708
Conversation
6fc6698
to
30ef534
Compare
@TomasHofman if you have a moment could you review this PR please? |
Sure, will check. |
// fallback on copy if Filesystem doesn't support hardlinks | ||
try { | ||
Files.createLink(backupRoot.resolve(relative), file); | ||
} catch (UnsupportedEncodingException e) { |
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.
Is that the exception that's gonna be thrown when unable to create a hardlink? I would expect UnsupportedOperationException.
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.
We may try to check explicitly if the paths are on the same filesystem and revert to copy if they are not, to avoid the exception. It would not simplify the code, just avoided the exception in one predictable case. No big deal though.
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.
good catch, thanks. That should be UnsupportedOperationException
.
We may try to check explicitly if the paths are on the same filesystem.
That would assume the installation of WildFly itself is split between different filesystems, Is that something we support/anticipate?
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.
Hmm, probably not 👍
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.
Looks OK to me.
231976f
to
66e77d6
Compare
Before applying changes to a server, backup the state of the server in a
<SERVER_HOME>.update.old
folder. The backup is done using hardlinks if the file system allows it to save disk space.If the update fails due to IOException, we try and restore the server state. If the update is interrupted, either by the user or a program crash, the original state will be available for the user to perform manual restore.