OpenSearch/distribution
Jason Tedor fe91c72151 Use a marker file when removing a plugin
Today when removing a plugin, we attempt to move the plugin directory to
a temporary directory and then delete that directory from the
filesystem. We do this to avoid a plugin being in a half-removed
state. We previously tried an atomic move, and fell back to a non-atomic
move if that failed. Atomic moves can fail on union filesystems when the
plugin directory is not in the top layer of the
filesystem. Interestingly, the regular move can fail as well. This is
because when the JDK is executing such a move, it first tries to rename
the source directory to the target directory and if this fails with
EXDEV (as in the case of an atomic move failing), it falls back to
copying the source to the target, and then attempts to rmdir the
source. The bug here is that the JDK never deleted the contents of the
source so the rmdir will always fail (except in the case of an empty
directory).

Given all this silliness, we were inspired to find a different
strategy. The strategy is simple. We will add a marker file to the
plugin directory that indicates the plugin is in a state of
removal. This file will be the last file out the door during removal. If
this file exists during startup, we fail startup.

Relates #24252
2017-04-21 15:50:44 -04:00
..
bwc-zip Revert "Ensure output for createClone task" 2017-04-15 13:54:01 -04:00
deb Tests: Clean up rest test file handling (#21392) 2017-04-18 15:07:08 -07:00
integ-test-zip Tests: Clean up rest test file handling (#21392) 2017-04-18 15:07:08 -07:00
rpm Tests: Clean up rest test file handling (#21392) 2017-04-18 15:07:08 -07:00
src/main Remove customization of ES_USER and ES_GROUP 2017-04-14 13:24:21 -06:00
tar Tests: Clean up rest test file handling (#21392) 2017-04-18 15:07:08 -07:00
tools Use a marker file when removing a plugin 2017-04-21 15:50:44 -04:00
zip Tests: Clean up rest test file handling (#21392) 2017-04-18 15:07:08 -07:00
build.gradle Build: Move plugin cli and tests to distribution tool (#24220) 2017-04-21 09:25:58 -07:00