diff --git a/buildscripts/rewrite-old-new.sh b/buildscripts/rewrite-old-new.sh index 55c4436c9..5d0c2b706 100755 --- a/buildscripts/rewrite-old-new.sh +++ b/buildscripts/rewrite-old-new.sh @@ -87,8 +87,8 @@ function verify_rewrite() { exit 1 fi - go build ./docs/debugging/s3-check-md5/ - if ! ./s3-check-md5 \ + go install github.com/minio/minio/docs/debugging/s3-check-md5@latest + if ! s3-check-md5 \ -debug \ -versions \ -access-key minio \ @@ -113,7 +113,7 @@ function verify_rewrite() { go run ./buildscripts/heal-manual.go "127.0.0.1:${start_port}" "minio" "minio123" sleep 1 - if ! ./s3-check-md5 \ + if ! s3-check-md5 \ -debug \ -versions \ -access-key minio \ diff --git a/buildscripts/unaligned-healing.sh b/buildscripts/unaligned-healing.sh index d605eba92..872b9e894 100755 --- a/buildscripts/unaligned-healing.sh +++ b/buildscripts/unaligned-healing.sh @@ -82,8 +82,8 @@ function start_minio_16drive() { rm -rf "${WORK_DIR}/xl3/healing-shard-bucket/unaligned" sleep 10 - go build ./docs/debugging/s3-check-md5/ - if ! ./s3-check-md5 \ + go install github.com/minio/minio/docs/debugging/s3-check-md5@latest + if ! s3-check-md5 \ -debug \ -access-key minio \ -secret-key minio123 \ @@ -111,7 +111,7 @@ function start_minio_16drive() { exit 1 fi - if ! ./s3-check-md5 \ + if ! s3-check-md5 \ -debug \ -access-key minio \ -secret-key minio123 \ @@ -134,7 +134,7 @@ function start_minio_16drive() { "${WORK_DIR}/mc" admin heal --quiet --recursive minio/healing-shard-bucket - if ! ./s3-check-md5 \ + if ! s3-check-md5 \ -debug \ -access-key minio \ -secret-key minio123 \ diff --git a/cmd/bucket-replication.go b/cmd/bucket-replication.go index 92f4587ba..6ae0db752 100644 --- a/cmd/bucket-replication.go +++ b/cmd/bucket-replication.go @@ -2487,7 +2487,7 @@ func newresyncer() *replicationResyncer { } // mark status of replication resync on remote target for the bucket -func (s *replicationResyncer) markStatus(status ResyncStatusType, opts resyncOpts) { +func (s *replicationResyncer) markStatus(status ResyncStatusType, opts resyncOpts, objAPI ObjectLayer) { s.Lock() defer s.Unlock() @@ -2498,6 +2498,10 @@ func (s *replicationResyncer) markStatus(status ResyncStatusType, opts resyncOpt m.TargetsMap[opts.arn] = st m.LastUpdate = UTCNow() s.statusMap[opts.bucket] = m + + ctx, cancel := context.WithTimeout(context.Background(), time.Second) + defer cancel() + saveResyncStatus(ctx, opts.bucket, m, objAPI) } // update replication resync stats for bucket's remote target @@ -2527,7 +2531,7 @@ func (s *replicationResyncer) resyncBucket(ctx context.Context, objectAPI Object resyncStatus := ResyncFailed defer func() { - s.markStatus(resyncStatus, opts) + s.markStatus(resyncStatus, opts, objectAPI) globalSiteResyncMetrics.incBucket(opts, resyncStatus) s.workerCh <- struct{}{} }() @@ -2563,7 +2567,7 @@ func (s *replicationResyncer) resyncBucket(ctx context.Context, objectAPI Object } // mark resync status as resync started if !heal { - s.markStatus(ResyncStarted, opts) + s.markStatus(ResyncStarted, opts, objectAPI) } // Walk through all object versions - Walk() is always in ascending order needed to ensure diff --git a/cmd/xl-storage.go b/cmd/xl-storage.go index ce765ca32..f08b8f2e2 100644 --- a/cmd/xl-storage.go +++ b/cmd/xl-storage.go @@ -1061,12 +1061,7 @@ func (s *xlStorage) deleteVersions(ctx context.Context, volume, path string, fis return s.WriteAll(ctx, volume, pathJoin(path, xlStorageFormatFile), buf) } - // Move xl.meta to trash - err = s.moveToTrash(pathJoin(volumeDir, path, xlStorageFormatFile), false, false) - if err == nil || err == errFileNotFound { - s.deleteFile(volumeDir, pathJoin(volumeDir, path), false, false) - } - return err + return s.deleteFile(volumeDir, pathJoin(volumeDir, path), true, false) } // DeleteVersions deletes slice of versions, it can be same object diff --git a/docs/bucket/replication/setup_3site_replication.sh b/docs/bucket/replication/setup_3site_replication.sh index d471da3c2..fc75cc8d2 100755 --- a/docs/bucket/replication/setup_3site_replication.sh +++ b/docs/bucket/replication/setup_3site_replication.sh @@ -41,7 +41,8 @@ unset MINIO_KMS_KES_KEY_FILE unset MINIO_KMS_KES_ENDPOINT unset MINIO_KMS_KES_KEY_NAME -go build ./docs/debugging/s3-check-md5/ +go install github.com/minio/minio/docs/debugging/s3-check-md5@latest + wget -O mc https://dl.minio.io/client/mc/release/linux-amd64/mc && chmod +x mc wget -O mc.RELEASE.2021-03-12T03-36-59Z https://dl.minio.io/client/mc/release/linux-amd64/archive/mc.RELEASE.2021-03-12T03-36-59Z && @@ -194,18 +195,18 @@ head -c 221227088 200M sleep 10 echo "Verifying ETag for all objects" -./s3-check-md5 -versions -access-key minio -secret-key minio123 -endpoint http://127.0.0.1:9001/ -bucket bucket -./s3-check-md5 -versions -access-key minio -secret-key minio123 -endpoint http://127.0.0.1:9002/ -bucket bucket -./s3-check-md5 -versions -access-key minio -secret-key minio123 -endpoint http://127.0.0.1:9003/ -bucket bucket -./s3-check-md5 -versions -access-key minio -secret-key minio123 -endpoint http://127.0.0.1:9004/ -bucket bucket -./s3-check-md5 -versions -access-key minio -secret-key minio123 -endpoint http://127.0.0.1:9005/ -bucket bucket -./s3-check-md5 -versions -access-key minio -secret-key minio123 -endpoint http://127.0.0.1:9006/ -bucket bucket +s3-check-md5 -versions -access-key minio -secret-key minio123 -endpoint http://127.0.0.1:9001/ -bucket bucket +s3-check-md5 -versions -access-key minio -secret-key minio123 -endpoint http://127.0.0.1:9002/ -bucket bucket +s3-check-md5 -versions -access-key minio -secret-key minio123 -endpoint http://127.0.0.1:9003/ -bucket bucket +s3-check-md5 -versions -access-key minio -secret-key minio123 -endpoint http://127.0.0.1:9004/ -bucket bucket +s3-check-md5 -versions -access-key minio -secret-key minio123 -endpoint http://127.0.0.1:9005/ -bucket bucket +s3-check-md5 -versions -access-key minio -secret-key minio123 -endpoint http://127.0.0.1:9006/ -bucket bucket -./s3-check-md5 -versions -access-key minio -secret-key minio123 -endpoint http://127.0.0.1:9001/ -bucket olockbucket -./s3-check-md5 -versions -access-key minio -secret-key minio123 -endpoint http://127.0.0.1:9002/ -bucket olockbucket -./s3-check-md5 -versions -access-key minio -secret-key minio123 -endpoint http://127.0.0.1:9003/ -bucket olockbucket -./s3-check-md5 -versions -access-key minio -secret-key minio123 -endpoint http://127.0.0.1:9004/ -bucket olockbucket -./s3-check-md5 -versions -access-key minio -secret-key minio123 -endpoint http://127.0.0.1:9005/ -bucket olockbucket -./s3-check-md5 -versions -access-key minio -secret-key minio123 -endpoint http://127.0.0.1:9006/ -bucket olockbucket +s3-check-md5 -versions -access-key minio -secret-key minio123 -endpoint http://127.0.0.1:9001/ -bucket olockbucket +s3-check-md5 -versions -access-key minio -secret-key minio123 -endpoint http://127.0.0.1:9002/ -bucket olockbucket +s3-check-md5 -versions -access-key minio -secret-key minio123 -endpoint http://127.0.0.1:9003/ -bucket olockbucket +s3-check-md5 -versions -access-key minio -secret-key minio123 -endpoint http://127.0.0.1:9004/ -bucket olockbucket +s3-check-md5 -versions -access-key minio -secret-key minio123 -endpoint http://127.0.0.1:9005/ -bucket olockbucket +s3-check-md5 -versions -access-key minio -secret-key minio123 -endpoint http://127.0.0.1:9006/ -bucket olockbucket catch