Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[Greenplum] do not fail backup on increment reading error #1365

Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Jump to
Jump to file
Failed to load files.
Diff view
Diff view
13 changes: 12 additions & 1 deletion internal/databases/greenplum/ao_storage_uploader.go
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,8 @@ import (
"path"
"sync"

"github.com/wal-g/wal-g/utility"

"github.com/wal-g/tracelog"
"github.com/wal-g/wal-g/internal"
"github.com/wal-g/wal-g/internal/compression"
Expand Down Expand Up @@ -75,7 +77,15 @@ func (u *AoStorageUploader) addFile(cfi *internal.ComposeFileInfo, aoMeta AoRelF
tracelog.DebugLogger.Printf(
"%s: EOF (local %d, remote %d), ModCount (local %d, remote %d), will perform an incremental upload",
cfi.Header.Name, aoMeta.eof, remoteFile.EOF, aoMeta.modCount, remoteFile.ModCount)
return u.incrementalAoUpload(remoteFile.StoragePath, cfi, aoMeta, remoteFile.EOF)

err := u.incrementalAoUpload(remoteFile.StoragePath, cfi, aoMeta, remoteFile.EOF)
if err == nil {
return nil
}

tracelog.WarningLogger.Printf("%s: incremental upload failed, will perform a regular upload: %v",
cfi.Header.Name, err)
return u.regularAoUpload(cfi, aoMeta, location)
}

if aoMeta.eof != remoteFile.EOF {
Expand Down Expand Up @@ -146,6 +156,7 @@ func (u *AoStorageUploader) incrementalAoUpload(
if err != nil {
return err
}
defer utility.LoggedClose(file, "")

incrementalReader, err := NewIncrementalPageReader(file, aoMeta.eof, baseFileEOF)
if err != nil {
Expand Down