mirror of
https://github.com/minio/minio.git
synced 2025-03-31 09:43:43 -04:00
fix: tests and resync replication status (#18244)
This commit is contained in:
parent
b3e7de010d
commit
e1e33077e8
@ -87,8 +87,8 @@ function verify_rewrite() {
|
|||||||
exit 1
|
exit 1
|
||||||
fi
|
fi
|
||||||
|
|
||||||
go build ./docs/debugging/s3-check-md5/
|
go install github.com/minio/minio/docs/debugging/s3-check-md5@latest
|
||||||
if ! ./s3-check-md5 \
|
if ! s3-check-md5 \
|
||||||
-debug \
|
-debug \
|
||||||
-versions \
|
-versions \
|
||||||
-access-key minio \
|
-access-key minio \
|
||||||
@ -113,7 +113,7 @@ function verify_rewrite() {
|
|||||||
go run ./buildscripts/heal-manual.go "127.0.0.1:${start_port}" "minio" "minio123"
|
go run ./buildscripts/heal-manual.go "127.0.0.1:${start_port}" "minio" "minio123"
|
||||||
sleep 1
|
sleep 1
|
||||||
|
|
||||||
if ! ./s3-check-md5 \
|
if ! s3-check-md5 \
|
||||||
-debug \
|
-debug \
|
||||||
-versions \
|
-versions \
|
||||||
-access-key minio \
|
-access-key minio \
|
||||||
|
@ -82,8 +82,8 @@ function start_minio_16drive() {
|
|||||||
rm -rf "${WORK_DIR}/xl3/healing-shard-bucket/unaligned"
|
rm -rf "${WORK_DIR}/xl3/healing-shard-bucket/unaligned"
|
||||||
sleep 10
|
sleep 10
|
||||||
|
|
||||||
go build ./docs/debugging/s3-check-md5/
|
go install github.com/minio/minio/docs/debugging/s3-check-md5@latest
|
||||||
if ! ./s3-check-md5 \
|
if ! s3-check-md5 \
|
||||||
-debug \
|
-debug \
|
||||||
-access-key minio \
|
-access-key minio \
|
||||||
-secret-key minio123 \
|
-secret-key minio123 \
|
||||||
@ -111,7 +111,7 @@ function start_minio_16drive() {
|
|||||||
exit 1
|
exit 1
|
||||||
fi
|
fi
|
||||||
|
|
||||||
if ! ./s3-check-md5 \
|
if ! s3-check-md5 \
|
||||||
-debug \
|
-debug \
|
||||||
-access-key minio \
|
-access-key minio \
|
||||||
-secret-key minio123 \
|
-secret-key minio123 \
|
||||||
@ -134,7 +134,7 @@ function start_minio_16drive() {
|
|||||||
|
|
||||||
"${WORK_DIR}/mc" admin heal --quiet --recursive minio/healing-shard-bucket
|
"${WORK_DIR}/mc" admin heal --quiet --recursive minio/healing-shard-bucket
|
||||||
|
|
||||||
if ! ./s3-check-md5 \
|
if ! s3-check-md5 \
|
||||||
-debug \
|
-debug \
|
||||||
-access-key minio \
|
-access-key minio \
|
||||||
-secret-key minio123 \
|
-secret-key minio123 \
|
||||||
|
@ -2487,7 +2487,7 @@ func newresyncer() *replicationResyncer {
|
|||||||
}
|
}
|
||||||
|
|
||||||
// mark status of replication resync on remote target for the bucket
|
// 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()
|
s.Lock()
|
||||||
defer s.Unlock()
|
defer s.Unlock()
|
||||||
|
|
||||||
@ -2498,6 +2498,10 @@ func (s *replicationResyncer) markStatus(status ResyncStatusType, opts resyncOpt
|
|||||||
m.TargetsMap[opts.arn] = st
|
m.TargetsMap[opts.arn] = st
|
||||||
m.LastUpdate = UTCNow()
|
m.LastUpdate = UTCNow()
|
||||||
s.statusMap[opts.bucket] = m
|
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
|
// update replication resync stats for bucket's remote target
|
||||||
@ -2527,7 +2531,7 @@ func (s *replicationResyncer) resyncBucket(ctx context.Context, objectAPI Object
|
|||||||
|
|
||||||
resyncStatus := ResyncFailed
|
resyncStatus := ResyncFailed
|
||||||
defer func() {
|
defer func() {
|
||||||
s.markStatus(resyncStatus, opts)
|
s.markStatus(resyncStatus, opts, objectAPI)
|
||||||
globalSiteResyncMetrics.incBucket(opts, resyncStatus)
|
globalSiteResyncMetrics.incBucket(opts, resyncStatus)
|
||||||
s.workerCh <- struct{}{}
|
s.workerCh <- struct{}{}
|
||||||
}()
|
}()
|
||||||
@ -2563,7 +2567,7 @@ func (s *replicationResyncer) resyncBucket(ctx context.Context, objectAPI Object
|
|||||||
}
|
}
|
||||||
// mark resync status as resync started
|
// mark resync status as resync started
|
||||||
if !heal {
|
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
|
// Walk through all object versions - Walk() is always in ascending order needed to ensure
|
||||||
|
@ -1061,12 +1061,7 @@ func (s *xlStorage) deleteVersions(ctx context.Context, volume, path string, fis
|
|||||||
return s.WriteAll(ctx, volume, pathJoin(path, xlStorageFormatFile), buf)
|
return s.WriteAll(ctx, volume, pathJoin(path, xlStorageFormatFile), buf)
|
||||||
}
|
}
|
||||||
|
|
||||||
// Move xl.meta to trash
|
return s.deleteFile(volumeDir, pathJoin(volumeDir, path), true, false)
|
||||||
err = s.moveToTrash(pathJoin(volumeDir, path, xlStorageFormatFile), false, false)
|
|
||||||
if err == nil || err == errFileNotFound {
|
|
||||||
s.deleteFile(volumeDir, pathJoin(volumeDir, path), false, false)
|
|
||||||
}
|
|
||||||
return err
|
|
||||||
}
|
}
|
||||||
|
|
||||||
// DeleteVersions deletes slice of versions, it can be same object
|
// DeleteVersions deletes slice of versions, it can be same object
|
||||||
|
@ -41,7 +41,8 @@ unset MINIO_KMS_KES_KEY_FILE
|
|||||||
unset MINIO_KMS_KES_ENDPOINT
|
unset MINIO_KMS_KES_ENDPOINT
|
||||||
unset MINIO_KMS_KES_KEY_NAME
|
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 &&
|
wget -O mc https://dl.minio.io/client/mc/release/linux-amd64/mc &&
|
||||||
chmod +x 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 &&
|
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 </dev/urandom >200M
|
|||||||
sleep 10
|
sleep 10
|
||||||
|
|
||||||
echo "Verifying ETag for all objects"
|
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: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: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: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: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: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: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: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: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: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: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: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:9006/ -bucket olockbucket
|
||||||
|
|
||||||
catch
|
catch
|
||||||
|
Loading…
x
Reference in New Issue
Block a user