Skip to content

Commit

Permalink
fix: bundle check
Browse files Browse the repository at this point in the history
  • Loading branch information
alexgao001 committed Sep 2, 2024
1 parent 5e0dcd6 commit af67d5c
Showing 1 changed file with 10 additions and 2 deletions.
12 changes: 10 additions & 2 deletions syncer/syncer.go
Original file line number Diff line number Diff line change
Expand Up @@ -255,8 +255,16 @@ func (s *BlobSyncer) process(bundleName string, blockID uint64, sidecars []*type
}
if blockID == s.bundleDetail.finalizeBlockID {
// this is idempotent
err = s.finalizeCurBundle(bundleName)
if err != nil {
_, err = s.bundleClient.GetBundleInfo(s.getBucketName(), bundleName)
if err == nil {
logging.Logger.Infof("bundle %s already exists in bundle service", bundleName)
return s.blobDao.UpdateBundleStatus(bundleName, db.Finalized)
}
if !errors.Is(err, cmn.ErrorBundleNotExist) {
logging.Logger.Errorf("failed to get bundle info, bundle=%s, err=%s", bundleName, err.Error())
return err
}
if err = s.finalizeCurBundle(bundleName); err != nil {
logging.Logger.Errorf("failed to finalize bundle, bundle=%s, err=%s", bundleName, err.Error())
return err
}
Expand Down

0 comments on commit af67d5c

Please sign in to comment.