diff --git a/.github/workflows/multipart/migrate.sh b/.github/workflows/multipart/migrate.sh index 3057bbf3e..49e0d5fec 100755 --- a/.github/workflows/multipart/migrate.sh +++ b/.github/workflows/multipart/migrate.sh @@ -25,8 +25,8 @@ if [ ! -f ./mc ]; then fi ( - cd /tmp - go install github.com/minio/minio/docs/debugging/s3-check-md5@master + cd ./docs/debugging/s3-check-md5 + go install -v ) export RELEASE=RELEASE.2023-08-29T23-07-35Z diff --git a/Makefile b/Makefile index 8a0f5c383..485e1b1eb 100644 --- a/Makefile +++ b/Makefile @@ -177,9 +177,9 @@ docker: build ## builds minio docker container @docker build -q --no-cache -t $(TAG) . -f Dockerfile install-race: checks ## builds minio to $(PWD) - @echo "Building minio binary to './minio'" + @echo "Building minio binary with -race to './minio'" @GORACE=history_size=7 CGO_ENABLED=1 go build -tags kqueue -race -trimpath --ldflags "$(LDFLAGS)" -o $(PWD)/minio 1>/dev/null - @echo "Installing minio binary to '$(GOPATH)/bin/minio'" + @echo "Installing minio binary with -race to '$(GOPATH)/bin/minio'" @mkdir -p $(GOPATH)/bin && cp -f $(PWD)/minio $(GOPATH)/bin/minio install: build ## builds minio and installs it to $GOPATH/bin. diff --git a/buildscripts/rewrite-old-new.sh b/buildscripts/rewrite-old-new.sh index aa22ab747..0dfef4670 100755 --- a/buildscripts/rewrite-old-new.sh +++ b/buildscripts/rewrite-old-new.sh @@ -87,7 +87,11 @@ function verify_rewrite() { exit 1 fi - go install github.com/minio/minio/docs/debugging/s3-check-md5@master + ( + cd ./docs/debugging/s3-check-md5 + go install -v + ) + if ! s3-check-md5 \ -debug \ -versions \ diff --git a/cmd/background-newdisks-heal-ops.go b/cmd/background-newdisks-heal-ops.go index 08cefa681..fba8c1799 100644 --- a/cmd/background-newdisks-heal-ops.go +++ b/cmd/background-newdisks-heal-ops.go @@ -353,7 +353,7 @@ func initAutoHeal(ctx context.Context, objAPI ObjectLayer) { func getLocalDisksToHeal() (disksToHeal Endpoints) { globalLocalDrivesMu.RLock() - localDrives := globalLocalDrives + localDrives := cloneDrives(globalLocalDrives) globalLocalDrivesMu.RUnlock() for _, disk := range localDrives { _, err := disk.GetDiskID() diff --git a/cmd/bucket-replication.go b/cmd/bucket-replication.go index 35421dd2d..5ab136497 100644 --- a/cmd/bucket-replication.go +++ b/cmd/bucket-replication.go @@ -3393,7 +3393,7 @@ func (p *ReplicationPool) persistToDrive(ctx context.Context, v MRFReplicateEntr } globalLocalDrivesMu.RLock() - localDrives := globalLocalDrives + localDrives := cloneDrives(globalLocalDrives) globalLocalDrivesMu.RUnlock() for _, localDrive := range localDrives { @@ -3460,7 +3460,7 @@ func (p *ReplicationPool) loadMRF() (mrfRec MRFReplicateEntries, err error) { } globalLocalDrivesMu.RLock() - localDrives := globalLocalDrives + localDrives := cloneDrives(globalLocalDrives) globalLocalDrivesMu.RUnlock() for _, localDrive := range localDrives { diff --git a/cmd/metrics-resource.go b/cmd/metrics-resource.go index c218b1421..0734d811b 100644 --- a/cmd/metrics-resource.go +++ b/cmd/metrics-resource.go @@ -274,7 +274,7 @@ func collectDriveMetrics(m madmin.RealtimeMetrics) { } globalLocalDrivesMu.RLock() - localDrives := globalLocalDrives + localDrives := cloneDrives(globalLocalDrives) globalLocalDrivesMu.RUnlock() for _, d := range localDrives { diff --git a/cmd/peer-rest-server.go b/cmd/peer-rest-server.go index e3a338efe..d4f4f27d6 100644 --- a/cmd/peer-rest-server.go +++ b/cmd/peer-rest-server.go @@ -786,7 +786,7 @@ var errUnsupportedSignal = fmt.Errorf("unsupported signal") func waitingDrivesNode() map[string]madmin.DiskMetrics { globalLocalDrivesMu.RLock() - localDrives := globalLocalDrives + localDrives := cloneDrives(globalLocalDrives) globalLocalDrivesMu.RUnlock() errs := make([]error, len(localDrives)) diff --git a/cmd/peer-s3-server.go b/cmd/peer-s3-server.go index 1f658855e..e4fd92c97 100644 --- a/cmd/peer-s3-server.go +++ b/cmd/peer-s3-server.go @@ -82,7 +82,7 @@ func (s *peerS3Server) HealthHandler(w http.ResponseWriter, r *http.Request) { func healBucketLocal(ctx context.Context, bucket string, opts madmin.HealOpts) (res madmin.HealResultItem, err error) { globalLocalDrivesMu.RLock() - localDrives := globalLocalDrives + localDrives := cloneDrives(globalLocalDrives) globalLocalDrivesMu.RUnlock() // Initialize sync waitgroup. @@ -206,7 +206,7 @@ func healBucketLocal(ctx context.Context, bucket string, opts madmin.HealOpts) ( func listBucketsLocal(ctx context.Context, opts BucketOptions) (buckets []BucketInfo, err error) { globalLocalDrivesMu.RLock() - localDrives := globalLocalDrives + localDrives := cloneDrives(globalLocalDrives) globalLocalDrivesMu.RUnlock() quorum := (len(localDrives) / 2) @@ -252,9 +252,15 @@ func listBucketsLocal(ctx context.Context, opts BucketOptions) (buckets []Bucket return buckets, nil } +func cloneDrives(drives []StorageAPI) []StorageAPI { + newDrives := make([]StorageAPI, len(drives)) + copy(newDrives, drives) + return newDrives +} + func getBucketInfoLocal(ctx context.Context, bucket string, opts BucketOptions) (BucketInfo, error) { globalLocalDrivesMu.RLock() - localDrives := globalLocalDrives + localDrives := cloneDrives(globalLocalDrives) globalLocalDrivesMu.RUnlock() g := errgroup.WithNErrs(len(localDrives)).WithConcurrency(32) @@ -303,7 +309,7 @@ func getBucketInfoLocal(ctx context.Context, bucket string, opts BucketOptions) func deleteBucketLocal(ctx context.Context, bucket string, opts DeleteBucketOptions) error { globalLocalDrivesMu.RLock() - localDrives := globalLocalDrives + localDrives := cloneDrives(globalLocalDrives) globalLocalDrivesMu.RUnlock() g := errgroup.WithNErrs(len(localDrives)).WithConcurrency(32) @@ -341,7 +347,7 @@ func deleteBucketLocal(ctx context.Context, bucket string, opts DeleteBucketOpti func makeBucketLocal(ctx context.Context, bucket string, opts MakeBucketOptions) error { globalLocalDrivesMu.RLock() - localDrives := globalLocalDrives + localDrives := cloneDrives(globalLocalDrives) globalLocalDrivesMu.RUnlock() g := errgroup.WithNErrs(len(localDrives)).WithConcurrency(32) diff --git a/docs/bucket/replication/delete-replication.sh b/docs/bucket/replication/delete-replication.sh index 68561cd38..b8c33c7ed 100755 --- a/docs/bucket/replication/delete-replication.sh +++ b/docs/bucket/replication/delete-replication.sh @@ -75,9 +75,13 @@ echo "=== myminio1" echo "=== myminio2" ./mc ls --versions myminio2/testbucket/dir/file -versionId="$(mc ls --json --versions myminio1/testbucket/dir/ | tail -n1 | jq -r .versionId)" +versionId="$(./mc ls --json --versions myminio1/testbucket/dir/ | tail -n1 | jq -r .versionId)" -aws s3api --endpoint-url http://localhost:9001 --profile minio delete-object --bucket testbucket --key dir/file --version-id "$versionId" +aws configure set aws_access_key_id minioadmin --profile minioadmin +aws configure set aws_secret_access_key minioadmin --profile minioadmin +aws configure set default.region us-east-1 --profile minioadmin + +aws s3api --endpoint-url http://localhost:9001 --profile minioadmin delete-object --bucket testbucket --key dir/file --version-id "$versionId" ./mc ls -r --versions myminio1/testbucket >/tmp/myminio1.txt ./mc ls -r --versions myminio2/testbucket >/tmp/myminio2.txt diff --git a/docs/bucket/replication/setup_3site_replication.sh b/docs/bucket/replication/setup_3site_replication.sh index 0789f5e8f..193fc8be1 100755 --- a/docs/bucket/replication/setup_3site_replication.sh +++ b/docs/bucket/replication/setup_3site_replication.sh @@ -41,7 +41,10 @@ unset MINIO_KMS_KES_KEY_FILE unset MINIO_KMS_KES_ENDPOINT unset MINIO_KMS_KES_KEY_NAME -go install github.com/minio/minio/docs/debugging/s3-check-md5@latest +( + cd ./docs/debugging/s3-check-md5 + go install -v +) wget -O mc https://dl.minio.io/client/mc/release/linux-amd64/mc && chmod +x mc diff --git a/docs/debugging/s3-check-md5/main.go b/docs/debugging/s3-check-md5/main.go index f2ff31af8..de1f1e302 100644 --- a/docs/debugging/s3-check-md5/main.go +++ b/docs/debugging/s3-check-md5/main.go @@ -163,7 +163,7 @@ func main() { continue } if v, ok := object.UserMetadata["X-Amz-Server-Side-Encryption"]; ok && v == "aws:kms" { - log.Println("FAILED: encrypted with SSE-KMS do not have md5sum as ETag:", objFullPath(object)) + log.Println("SKIPPED: encrypted with SSE-KMS do not have md5sum as ETag:", objFullPath(object)) continue } parts := 1 diff --git a/docs/distributed/decom-compressed-sse-s3.sh b/docs/distributed/decom-compressed-sse-s3.sh index 8f1e4f109..5f0bede1d 100755 --- a/docs/distributed/decom-compressed-sse-s3.sh +++ b/docs/distributed/decom-compressed-sse-s3.sh @@ -147,7 +147,10 @@ if [ $ret -ne 0 ]; then exit 1 fi -go install github.com/minio/minio/docs/debugging/s3-check-md5@latest +( + cd ./docs/debugging/s3-check-md5 + go install -v +) s3-check-md5 -versions -access-key minioadmin -secret-key minioadmin -endpoint http://127.0.0.1:9001/ -bucket bucket2 s3-check-md5 -versions -access-key minioadmin -secret-key minioadmin -endpoint http://127.0.0.1:9001/ -bucket versioned diff --git a/docs/distributed/decom-encrypted-sse-s3.sh b/docs/distributed/decom-encrypted-sse-s3.sh index 3ab966910..c28413280 100755 --- a/docs/distributed/decom-encrypted-sse-s3.sh +++ b/docs/distributed/decom-encrypted-sse-s3.sh @@ -158,7 +158,10 @@ if [ $ret -ne 0 ]; then exit 1 fi -go install github.com/minio/minio/docs/debugging/s3-check-md5@latest +( + cd ./docs/debugging/s3-check-md5 + go install -v +) s3-check-md5 -versions -access-key minioadmin -secret-key minioadmin -endpoint http://127.0.0.1:9001/ -bucket bucket2 s3-check-md5 -versions -access-key minioadmin -secret-key minioadmin -endpoint http://127.0.0.1:9001/ -bucket versioned diff --git a/docs/distributed/decom-encrypted.sh b/docs/distributed/decom-encrypted.sh index 1cc0008a7..2eb2e1aa7 100755 --- a/docs/distributed/decom-encrypted.sh +++ b/docs/distributed/decom-encrypted.sh @@ -144,7 +144,10 @@ if [ "${expected_checksum}" != "${got_checksum}" ]; then exit 1 fi -go install github.com/minio/minio/docs/debugging/s3-check-md5@latest +( + cd ./docs/debugging/s3-check-md5 + go install -v +) s3-check-md5 -versions -access-key minioadmin -secret-key minioadmin -endpoint http://127.0.0.1:9001/ -bucket bucket2 s3-check-md5 -versions -access-key minioadmin -secret-key minioadmin -endpoint http://127.0.0.1:9001/ -bucket versioned diff --git a/docs/distributed/decom.sh b/docs/distributed/decom.sh index 37ec00653..80c2b4e41 100755 --- a/docs/distributed/decom.sh +++ b/docs/distributed/decom.sh @@ -210,7 +210,10 @@ if [ "${expected_checksum}" != "${got_checksum}" ]; then exit 1 fi -go install github.com/minio/minio/docs/debugging/s3-check-md5@latest +( + cd ./docs/debugging/s3-check-md5 + go install -v +) s3-check-md5 -versions -access-key minioadmin -secret-key minioadmin -endpoint http://127.0.0.1:9001/ -bucket bucket2 s3-check-md5 -versions -access-key minioadmin -secret-key minioadmin -endpoint http://127.0.0.1:9001/ -bucket versioned diff --git a/go.mod b/go.mod index 79c042730..ea4f204e9 100644 --- a/go.mod +++ b/go.mod @@ -45,7 +45,7 @@ require ( github.com/lithammer/shortuuid/v4 v4.0.0 github.com/miekg/dns v1.1.58 github.com/minio/cli v1.24.2 - github.com/minio/console v0.45.1-0.20240213061721-ee4d7b9b6940 + github.com/minio/console v0.46.0 github.com/minio/csvparser v1.0.0 github.com/minio/dnscache v0.1.1 github.com/minio/dperf v0.5.3 diff --git a/go.sum b/go.sum index 3a40ab4ce..286934c64 100644 --- a/go.sum +++ b/go.sum @@ -432,8 +432,8 @@ github.com/minio/cli v1.24.2 h1:J+fCUh9mhPLjN3Lj/YhklXvxj8mnyE/D6FpFduXJ2jg= github.com/minio/cli v1.24.2/go.mod h1:bYxnK0uS629N3Bq+AOZZ+6lwF77Sodk4+UL9vNuXhOY= github.com/minio/colorjson v1.0.6 h1:m7TUvpvt0u7FBmVIEQNIa0T4NBQlxrcMBp4wJKsg2Ik= github.com/minio/colorjson v1.0.6/go.mod h1:LUXwS5ZGNb6Eh9f+t+3uJiowD3XsIWtsvTriUBeqgYs= -github.com/minio/console v0.45.1-0.20240213061721-ee4d7b9b6940 h1:DdXAWKUmiSMFS3pPG351kwYo2YlC0EaKKCNStAmd7xo= -github.com/minio/console v0.45.1-0.20240213061721-ee4d7b9b6940/go.mod h1:VvJdNfELVCc2VELF1rJtIPCb3FcWGtNfM/Ktvnu2MZ0= +github.com/minio/console v0.46.0 h1:So7y3csQl7m3Llaxmbg5xiTCwlElUol8kUyVOViBRFY= +github.com/minio/console v0.46.0/go.mod h1:VvJdNfELVCc2VELF1rJtIPCb3FcWGtNfM/Ktvnu2MZ0= github.com/minio/csvparser v1.0.0 h1:xJEHcYK8ZAjeW4hNV9Zu30u+/2o4UyPnYgyjWp8b7ZU= github.com/minio/csvparser v1.0.0/go.mod h1:lKXskSLzPgC5WQyzP7maKH7Sl1cqvANXo9YCto8zbtM= github.com/minio/dnscache v0.1.1 h1:AMYLqomzskpORiUA1ciN9k7bZT1oB3YZN4cEIi88W5o=