Skip to content

Commit

Permalink
Merge branch 'master' into persist-heal-mrf
Browse files Browse the repository at this point in the history
  • Loading branch information
harshavardhana committed May 23, 2024
2 parents 034b199 + 7981509 commit b9aee10
Show file tree
Hide file tree
Showing 52 changed files with 861 additions and 288 deletions.
1 change: 0 additions & 1 deletion .github/workflows/go-cross.yml
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,6 @@ on:
pull_request:
branches:
- master
- next

# This ensures that previous jobs for the PR are canceled when the PR is
# updated.
Expand Down
3 changes: 1 addition & 2 deletions .github/workflows/go-fips.yml
Original file line number Diff line number Diff line change
Expand Up @@ -3,8 +3,7 @@ name: FIPS Build Test
on:
pull_request:
branches:
- master
- next
- master

# This ensures that previous jobs for the PR are canceled when the PR is
# updated.
Expand Down
3 changes: 1 addition & 2 deletions .github/workflows/go-healing.yml
Original file line number Diff line number Diff line change
Expand Up @@ -3,8 +3,7 @@ name: Healing Functional Tests
on:
pull_request:
branches:
- master
- next
- master

# This ensures that previous jobs for the PR are canceled when the PR is
# updated.
Expand Down
8 changes: 4 additions & 4 deletions .github/workflows/go-lint.yml
Original file line number Diff line number Diff line change
Expand Up @@ -3,12 +3,11 @@ name: Linters and Tests
on:
pull_request:
branches:
- master
- next
- master

# This ensures that previous jobs for the PR are canceled when the PR is
# updated.
concurrency:
concurrency:
group: ${{ github.workflow }}-${{ github.head_ref }}
cancel-in-progress: true

Expand All @@ -35,9 +34,10 @@ jobs:
CGO_ENABLED: 0
GO111MODULE: on
run: |
Set-MpPreference -DisableRealtimeMonitoring $true
netsh int ipv4 set dynamicport tcp start=60000 num=61000
go build --ldflags="-s -w" -o %GOPATH%\bin\minio.exe
go test -v --timeout 50m ./...
go test -v --timeout 120m ./...
- name: Build on ${{ matrix.os }}
if: matrix.os == 'ubuntu-latest'
env:
Expand Down
3 changes: 1 addition & 2 deletions .github/workflows/go.yml
Original file line number Diff line number Diff line change
Expand Up @@ -3,8 +3,7 @@ name: Functional Tests
on:
pull_request:
branches:
- master
- next
- master

# This ensures that previous jobs for the PR are canceled when the PR is
# updated.
Expand Down
3 changes: 1 addition & 2 deletions .github/workflows/helm-lint.yml
Original file line number Diff line number Diff line change
Expand Up @@ -3,8 +3,7 @@ name: Helm Chart linting
on:
pull_request:
branches:
- master
- next
- master

# This ensures that previous jobs for the PR are canceled when the PR is
# updated.
Expand Down
1 change: 0 additions & 1 deletion .github/workflows/iam-integrations.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,6 @@ on:
pull_request:
branches:
- master
- next

# This ensures that previous jobs for the PR are canceled when the PR is
# updated.
Expand Down
5 changes: 4 additions & 1 deletion .github/workflows/mint.yml
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,6 @@ on:
pull_request:
branches:
- master
- next

# This ensures that previous jobs for the PR are canceled when the PR is
# updated.
Expand Down Expand Up @@ -56,6 +55,10 @@ jobs:
run: |
${GITHUB_WORKSPACE}/.github/workflows/run-mint.sh "erasure" "minio" "minio123" "${{ steps.vars.outputs.sha_short }}"
- name: resiliency
run: |
${GITHUB_WORKSPACE}/.github/workflows/run-mint.sh "resiliency" "minio" "minio123" "${{ steps.vars.outputs.sha_short }}"
- name: The job must cleanup
if: ${{ always() }}
run: |
Expand Down
78 changes: 78 additions & 0 deletions .github/workflows/mint/minio-resiliency.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,78 @@
version: '3.7'

# Settings and configurations that are common for all containers
x-minio-common: &minio-common
image: quay.io/minio/minio:${JOB_NAME}
command: server --console-address ":9001" http://minio{1...4}/rdata{1...2}
expose:
- "9000"
- "9001"
environment:
MINIO_CI_CD: "on"
MINIO_ROOT_USER: "minio"
MINIO_ROOT_PASSWORD: "minio123"
MINIO_KMS_SECRET_KEY: "my-minio-key:OSMM+vkKUTCvQs9YL/CVMIMt43HFhkUpqJxTmGl6rYw="
MINIO_DRIVE_MAX_TIMEOUT: "5s"
healthcheck:
test: ["CMD", "mc", "ready", "local"]
interval: 5s
timeout: 5s
retries: 5

# starts 4 docker containers running minio server instances.
# using nginx reverse proxy, load balancing, you can access
# it through port 9000.
services:
minio1:
<<: *minio-common
hostname: minio1
volumes:
- rdata1-1:/rdata1
- rdata1-2:/rdata2

minio2:
<<: *minio-common
hostname: minio2
volumes:
- rdata2-1:/rdata1
- rdata2-2:/rdata2

minio3:
<<: *minio-common
hostname: minio3
volumes:
- rdata3-1:/rdata1
- rdata3-2:/rdata2

minio4:
<<: *minio-common
hostname: minio4
volumes:
- rdata4-1:/rdata1
- rdata4-2:/rdata2

nginx:
image: nginx:1.19.2-alpine
hostname: nginx
volumes:
- ./nginx-4-node.conf:/etc/nginx/nginx.conf:ro
ports:
- "9000:9000"
- "9001:9001"
depends_on:
- minio1
- minio2
- minio3
- minio4

## By default this config uses default local driver,
## For custom volumes replace with volume driver configuration.
volumes:
rdata1-1:
rdata1-2:
rdata2-1:
rdata2-2:
rdata3-1:
rdata3-2:
rdata4-1:
rdata4-2:
3 changes: 1 addition & 2 deletions .github/workflows/replication.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -3,8 +3,7 @@ name: MinIO advanced tests
on:
pull_request:
branches:
- master
- next
- master

# This ensures that previous jobs for the PR are canceled when the PR is
# updated.
Expand Down
3 changes: 1 addition & 2 deletions .github/workflows/root-disable.yml
Original file line number Diff line number Diff line change
Expand Up @@ -3,8 +3,7 @@ name: Root lockdown tests
on:
pull_request:
branches:
- master
- next
- master

# This ensures that previous jobs for the PR are canceled when the PR is
# updated.
Expand Down
17 changes: 16 additions & 1 deletion .github/workflows/run-mint.sh
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,7 @@ docker volume rm $(docker volume ls -f dangling=true) || true
cd .github/workflows/mint

docker-compose -f minio-${MODE}.yaml up -d
sleep 30s
sleep 1m

docker system prune -f || true
docker volume prune -f || true
Expand All @@ -26,6 +26,9 @@ docker volume rm $(docker volume ls -q -f dangling=true) || true
[ "${MODE}" == "pools" ] && docker-compose -f minio-${MODE}.yaml stop minio2
[ "${MODE}" == "pools" ] && docker-compose -f minio-${MODE}.yaml stop minio6

# Pause one node, to check that all S3 calls work while one node goes wrong
[ "${MODE}" == "resiliency" ] && docker-compose -f minio-${MODE}.yaml pause minio4

docker run --rm --net=mint_default \
--name="mint-${MODE}-${JOB_NAME}" \
-e SERVER_ENDPOINT="nginx:9000" \
Expand All @@ -35,6 +38,18 @@ docker run --rm --net=mint_default \
-e MINT_MODE="${MINT_MODE}" \
docker.io/minio/mint:edge

# FIXME: enable this after fixing aws-sdk-java-v2 tests
# # unpause the node, to check that all S3 calls work while one node goes wrong
# [ "${MODE}" == "resiliency" ] && docker-compose -f minio-${MODE}.yaml unpause minio4
# [ "${MODE}" == "resiliency" ] && docker run --rm --net=mint_default \
# --name="mint-${MODE}-${JOB_NAME}" \
# -e SERVER_ENDPOINT="nginx:9000" \
# -e ACCESS_KEY="${ACCESS_KEY}" \
# -e SECRET_KEY="${SECRET_KEY}" \
# -e ENABLE_HTTPS=0 \
# -e MINT_MODE="${MINT_MODE}" \
# docker.io/minio/mint:edge

docker-compose -f minio-${MODE}.yaml down || true
sleep 10s

Expand Down
3 changes: 1 addition & 2 deletions .github/workflows/shfmt.yml
Original file line number Diff line number Diff line change
Expand Up @@ -3,8 +3,7 @@ name: Shell formatting checks
on:
pull_request:
branches:
- master
- next
- master

permissions:
contents: read
Expand Down
3 changes: 1 addition & 2 deletions .github/workflows/upgrade-ci-cd.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -3,8 +3,7 @@ name: Upgrade old version tests
on:
pull_request:
branches:
- master
- next
- master

# This ensures that previous jobs for the PR are canceled when the PR is
# updated.
Expand Down
2 changes: 1 addition & 1 deletion buildscripts/disable-root.sh
Original file line number Diff line number Diff line change
Expand Up @@ -57,7 +57,7 @@ done

set +e

sleep 10
./mc ready minioadm/

./mc ls minioadm/
if [ $? -ne 0 ]; then
Expand Down
8 changes: 6 additions & 2 deletions cmd/admin-bucket-handlers.go
Original file line number Diff line number Diff line change
Expand Up @@ -837,9 +837,13 @@ func (a adminAPIHandlers) ImportBucketMetadataHandler(w http.ResponseWriter, r *
rpt.SetStatus(bucket, fileName, err)
continue
}

rcfg, err := globalBucketObjectLockSys.Get(bucket)
if err != nil {
rpt.SetStatus(bucket, fileName, err)
continue
}
// Validate the received bucket policy document
if err = bucketLifecycle.Validate(); err != nil {
if err = bucketLifecycle.Validate(rcfg); err != nil {
rpt.SetStatus(bucket, fileName, err)
continue
}
Expand Down
12 changes: 7 additions & 5 deletions cmd/admin-server-info.go
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
// Copyright (c) 2015-2021 MinIO, Inc.
// Copyright (c) 2015-2024 MinIO, Inc.
//
// This file is part of MinIO Object Storage stack
//
Expand All @@ -18,7 +18,6 @@
package cmd

import (
"context"
"math"
"net/http"
"os"
Expand All @@ -31,6 +30,7 @@ import (
"github.com/minio/madmin-go/v3"
"github.com/minio/minio/internal/config"
"github.com/minio/minio/internal/kms"
xnet "github.com/minio/pkg/v2/net"
)

// getLocalServerProperty - returns madmin.ServerProperties for only the
Expand Down Expand Up @@ -64,9 +64,11 @@ func getLocalServerProperty(endpointServerPools EndpointServerPools, r *http.Req
if err := isServerResolvable(endpoint, 5*time.Second); err == nil {
network[nodeName] = string(madmin.ItemOnline)
} else {
network[nodeName] = string(madmin.ItemOffline)
// log once the error
peersLogOnceIf(context.Background(), err, nodeName)
if xnet.IsNetworkOrHostDown(err, false) {
network[nodeName] = string(madmin.ItemOffline)
} else if xnet.IsNetworkOrHostDown(err, true) {
network[nodeName] = "connection attempt timedout"
}
}
}
}
Expand Down
5 changes: 3 additions & 2 deletions cmd/bucket-lifecycle-handlers.go
Original file line number Diff line number Diff line change
Expand Up @@ -64,7 +64,8 @@ func (api objectAPIHandlers) PutBucketLifecycleHandler(w http.ResponseWriter, r
}

// Check if bucket exists.
if _, err := objAPI.GetBucketInfo(ctx, bucket, BucketOptions{}); err != nil {
rcfg, err := globalBucketObjectLockSys.Get(bucket)
if err != nil {
writeErrorResponse(ctx, w, toAPIError(ctx, err), r.URL)
return
}
Expand All @@ -76,7 +77,7 @@ func (api objectAPIHandlers) PutBucketLifecycleHandler(w http.ResponseWriter, r
}

// Validate the received bucket policy document
if err = bucketLifecycle.Validate(); err != nil {
if err = bucketLifecycle.Validate(rcfg); err != nil {
writeErrorResponse(ctx, w, toAPIError(ctx, err), r.URL)
return
}
Expand Down
11 changes: 2 additions & 9 deletions cmd/common-main.go
Original file line number Diff line number Diff line change
Expand Up @@ -404,20 +404,13 @@ func buildServerCtxt(ctx *cli.Context, ctxt *serverCtxt) (err error) {

ctxt.FTP = ctx.StringSlice("ftp")
ctxt.SFTP = ctx.StringSlice("sftp")

ctxt.Interface = ctx.String("interface")
ctxt.UserTimeout = ctx.Duration("conn-user-timeout")
ctxt.ConnReadDeadline = ctx.Duration("conn-read-deadline")
ctxt.ConnWriteDeadline = ctx.Duration("conn-write-deadline")
ctxt.ConnClientReadDeadline = ctx.Duration("conn-client-read-deadline")
ctxt.ConnClientWriteDeadline = ctx.Duration("conn-client-write-deadline")
ctxt.SendBufSize = ctx.Int("send-buf-size")
ctxt.RecvBufSize = ctx.Int("recv-buf-size")

ctxt.ShutdownTimeout = ctx.Duration("shutdown-timeout")
ctxt.IdleTimeout = ctx.Duration("idle-timeout")
ctxt.ReadHeaderTimeout = ctx.Duration("read-header-timeout")
ctxt.MaxIdleConnsPerHost = ctx.Int("max-idle-conns-per-host")
ctxt.UserTimeout = ctx.Duration("conn-user-timeout")
ctxt.ShutdownTimeout = ctx.Duration("shutdown-timeout")

if conf := ctx.String("config"); len(conf) > 0 {
err = mergeServerCtxtFromConfigFile(conf, ctxt)
Expand Down
3 changes: 3 additions & 0 deletions cmd/erasure-decode.go
Original file line number Diff line number Diff line change
Expand Up @@ -202,6 +202,9 @@ func (p *parallelReader) Read(dst [][]byte) ([][]byte, error) {

// This will be communicated upstream.
p.orgReaders[bufIdx] = nil
if br, ok := p.readers[i].(io.Closer); ok {
br.Close()
}
p.readers[i] = nil

// Since ReadAt returned error, trigger another read.
Expand Down
1 change: 1 addition & 0 deletions cmd/erasure-healing.go
Original file line number Diff line number Diff line change
Expand Up @@ -258,6 +258,7 @@ func (er *erasureObjects) healObject(ctx context.Context, bucket string, object
healTrace(healingMetricObject, startTime, bucket, object, &opts, err, &result)
}()
}

// Initialize heal result object
result = madmin.HealResultItem{
Type: madmin.HealItemObject,
Expand Down

0 comments on commit b9aee10

Please sign in to comment.