MCPcopy Create free account
hub / github.com/dgraph-io/dgraph / CompleteBackup

Method CompleteBackup

worker/backup.go:709–737  ·  view source on GitHub ↗

CompleteBackup will finalize a backup by writing the manifest at the backup destination.

(ctx context.Context, m *Manifest)

Source from the content-addressed store, hash-verified

707
708// CompleteBackup will finalize a backup by writing the manifest at the backup destination.
709func (pr *BackupProcessor) CompleteBackup(ctx context.Context, m *Manifest) error {
710 if err := ctx.Err(); err != nil {
711 return err
712 }
713 uri, err := url.Parse(pr.Request.Destination)
714 if err != nil {
715 return err
716 }
717 handler, err := NewUriHandler(uri, GetCredentialsFromRequest(pr.Request))
718 if err != nil {
719 return err
720 }
721
722 manifest, err := GetManifestNoUpgrade(handler, uri)
723 if err != nil {
724 return err
725 }
726 manifest.Manifests = append(manifest.Manifests, m)
727
728 if err := CreateManifest(handler, uri, manifest); err != nil {
729 return errors.Wrap(err, "complete backup failed")
730 }
731 // Best-effort: write summary manifest. Failure does not abort the backup.
732 if err := CreateManifestSummary(handler, manifest); err != nil {
733 glog.Warningf("Failed to write backup summary manifest (non-fatal): %v", err)
734 }
735 glog.Infof("Backup completed OK.")
736 return nil
737}
738
739// GoString implements the GoStringer interface for Manifest.
740func (m *Manifest) GoString() string {

Callers 1

ProcessBackupRequestFunction · 0.95

Calls 8

NewUriHandlerFunction · 0.85
GetManifestNoUpgradeFunction · 0.85
CreateManifestFunction · 0.85
CreateManifestSummaryFunction · 0.85
WarningfMethod · 0.80
InfofMethod · 0.80
ParseMethod · 0.65

Tested by

no test coverage detected