bareos: bareos-16.2 bc43e15b
Author | Committer | Branch | Timestamp | Parent | |
---|---|---|---|---|---|
mvwieringen | mvwieringen | bareos-16.2 | 2017-06-28 19:41 | bareos-16.2 53ca1154 | Pending |
Changeset | gfapi: Fix backups with empty glusterfind filelist. The original plugin interface always expect one or more files to be backuped. With glusterfind it can happen that no files changed since the last backup which means when we do a setup_backup we return bRC_OK instead of bRC_More which normally means there are more files to backup (for determining what file needs to be processed next we use get_next_file_to_backup() which is also used in the endBackupFile() plugin function. Problem is however returning bRC_OK has different meaning when used in bEventBackupCommand e.g. start of backup vs endBackupFile() there is a nice and smart workaround and that is that we know normally get_next_file_to_backup() should always return bRC_More and only on an empty list a bRC_OK is returned. The way the initialization works we can return anything other then bRC_OK (bRC_Skip in our case) which means the loop never gets executed. As we now never get into the backup loop we also are no longer bitten by the side effect you see on backing up an empty file list e.g. failing backups due to the fact that the backup expects one or more valid so called savepackets. When the filelist is empty a savepacket with as sp_type zero is returned and that leads to the following error: 'no type in startBackupFile packet.' So the problem manifested itself as a way different error then what actually is the real problem. Corner case closed. |
||||
mod - src/filed/fd_plugins.c | Diff File | ||||
mod - src/plugins/filed/gfapi-fd.c | Diff File |