Ignore errors during mirror (#2562)

S3 lists 1000 objects in batches, but once this batch is being
processed to be copied over there is no way to lock across the
entire batch for mirroring. Due to this we introduce a scenario
when objects might have been deleted in parallel from another
application.

In such a scenario simply ignore such objects and proceed to
copy other files.

Fixes #2537
This commit is contained in:
Harshavardhana
2018-10-01 15:33:18 +05:30
committed by Nitish Tiwari
parent a83ffe321c
commit 7260b0f9ea
+5 -3
View File
@@ -290,9 +290,11 @@ func (mj *mirrorJob) startStatus() {
// Print in new line and adjust to top so that we
// don't print over the ongoing progress bar.
if sURLs.SourceContent != nil {
errorIf(sURLs.Error.Trace(sURLs.SourceContent.URL.String()),
fmt.Sprintf("Failed to copy `%s`.", sURLs.SourceContent.URL.String()))
os.Exit(1)
if !isErrIgnored(sURLs.Error) {
errorIf(sURLs.Error.Trace(sURLs.SourceContent.URL.String()),
fmt.Sprintf("Failed to copy `%s`.", sURLs.SourceContent.URL.String()))
os.Exit(1)
}
} else {
// When sURLs.SourceContent is nil, we know that we have an error related to removing
errorIf(sURLs.Error.Trace(sURLs.TargetContent.URL.String()),