Skip to content

Retry rsync when source files vanish during backup

What does this MR do?

Make "gitlab-backup create STRATEGY=copy" more robust by retrying the 'rsync' operation when 'rsync' returns error 24 (Partial transfer due to vanished source files), as well as using the --delete parameter to delete extraneous files from dest dirs.

Note that we have taken ownership of these changes from the customer in !48266 (closed) . We are creating a new MR because we are unable to push to the fork, or alter the source branch of the merge request.

Screenshots (strongly suggested)

Does this MR meet the acceptance criteria?

Conformity

Availability and Testing

Tested by adding status = 24 in between the rsync and retry loops:

2020-11-26 11:05:56 +1100 -- Dumping uploads ... 
Warning: files vanished during rsync, retrying...
2020-11-26 11:05:57 +1100 -- done
2020-11-26 11:05:57 +1100 -- Dumping builds ... 
Warning: files vanished during rsync, retrying...
2020-11-26 11:05:57 +1100 -- done
2020-11-26 11:05:57 +1100 -- Dumping artifacts ... 
Warning: files vanished during rsync, retrying...
2020-11-26 11:05:57 +1100 -- done
2020-11-26 11:05:57 +1100 -- Dumping pages ... 
Warning: files vanished during rsync, retrying...
2020-11-26 11:05:57 +1100 -- done
2020-11-26 11:05:57 +1100 -- Dumping lfs objects ... 
Warning: files vanished during rsync, retrying..

Very low risk as the retry is only invoked when rsync throws an error 24.

Security

If this MR contains changes to processing or storing of credentials or tokens, authorization and authentication methods and other items described in the security review guidelines:

  • Label as security and @ mention @gitlab-com/gl-security/appsec
  • The MR includes necessary changes to maintain consistency between UI, API, email, or other methods
  • Security reports checked/validated by a reviewer from the AppSec team
Edited by Thong Kuah

Merge request reports