forked from greenplum-db/gpbackup-archive
-
Notifications
You must be signed in to change notification settings - Fork 3
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Avoid using stderr to detect plugin failures, wait for plugin process…
…es (#89) Previously, gpbackup_helper would error out and abort restore operations if any plugin wrote anything to stderr. Additionally, when using the adb_ddp_plugin to restore data, gpbackup_helper did not wait for plugin processes, leading to a large number of zombie processes when restoring with the --resize-cluster flag, causing the process to stop. This patch removes the requirement for stderr to be empty. Now, messages directed to stderr are logged as warnings, allowing the process to continue without interruption. The helper can still detect when a plugin process has exited because the exit of a plugin process closes the associated reader handles, causing an error during subsequent read attempts. The patch also adds logic to wait and reap plugin processes. Instead of turning plugin processes into zombies, gpbackup_helper now calls Wait() on them. This action is performed every time a reader finishes copying its content. Wait() is not done in case of --single-data-file, because Wait() closes pipes immediately, but helper will reuse the same reader and read from its stdout pipe multiple times. Two new tests are introduced: the first one verifies that gpbackup_helper does not fail when a plugin writes something to stderr during the restore operation. The second test ensures that gpbackup_helper errors out when a plugin process terminates in the middle of the restore operation. Changes comparing to the original commit: 1. logWarning() is replaced with already existing logWarn(), that has the same functionality. 2. One of the calls to waitForPlugin() is removed as no more necessary, because there is no more nested loop over batches, and we can leave only one call for waitForPlugin() after 'LoopEnd' label. 3. Several variable names in the test were updated as old names do not exist anymore. Plus the pipefile name in the test was updated, as now it includes batch number. 4. log() doesn't exist anymore and is replaced with logVerbose(). 5. Unreachable call to logPlugin() is removed. 6. New tests are added to cover the case with cluster resize. 7. logPlugin() is merged into waitForPlugin(). 8. Tests are reworked to avoid goroutines. 9. Cleanup of plugin's test control files in the test is now done from a defer function in order not to leave them if test failed (otherwise a failed test could affect the subsequent tests). 10. SpecTimeout is added to some new tests to ensure that if the delta from this commit is broken, the test will not hang and will provide more useful output. (cherry picked from commit bb75d5a) Co-authored-by: Roman Eskin <[email protected]>
- Loading branch information
Showing
4 changed files
with
240 additions
and
24 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters