diff --git a/.github/workflows/go-lint.yml b/.github/workflows/go-lint.yml index c5fcf60888a78..f0f13d025cc2d 100644 --- a/.github/workflows/go-lint.yml +++ b/.github/workflows/go-lint.yml @@ -21,23 +21,13 @@ jobs: strategy: matrix: go-version: [1.22.x] - os: [ubuntu-latest, Windows] + os: [ubuntu-latest] steps: - uses: actions/checkout@v4 - uses: actions/setup-go@v5 with: go-version: ${{ matrix.go-version }} check-latest: true - - name: Build on ${{ matrix.os }} - if: matrix.os == 'Windows' - env: - 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 120m ./... - name: Build on ${{ matrix.os }} if: matrix.os == 'ubuntu-latest' env: diff --git a/cmd/erasure-server-pool.go b/cmd/erasure-server-pool.go index 761d310245b2f..1fcedb5ccac80 100644 --- a/cmd/erasure-server-pool.go +++ b/cmd/erasure-server-pool.go @@ -556,7 +556,7 @@ func (z *erasureServerPools) getPoolInfoExistingWithOpts(ctx context.Context, bu return pinfo, z.poolsWithObject(poolObjInfos, opts), nil } defPool = pinfo - if !isErrObjectNotFound(pinfo.Err) { + if !isErrObjectNotFound(pinfo.Err) && !isErrVersionNotFound(pinfo.Err) { return pinfo, noReadQuorumPools, pinfo.Err } @@ -1166,13 +1166,34 @@ func (z *erasureServerPools) DeleteObject(ctx context.Context, bucket string, ob } } + if opts.DataMovement { + objInfo, err = z.serverPools[pinfo.Index].DeleteObject(ctx, bucket, object, opts) + objInfo.Name = decodeDirObject(object) + return objInfo, err + } + // Delete concurrently in all server pools with read quorum error for unversioned objects. if len(noReadQuorumPools) > 0 && !opts.Versioned && !opts.VersionSuspended { return z.deleteObjectFromAllPools(ctx, bucket, object, opts, noReadQuorumPools) } - objInfo, err = z.serverPools[pinfo.Index].DeleteObject(ctx, bucket, object, opts) + + for _, pool := range z.serverPools { + objInfo, err := pool.DeleteObject(ctx, bucket, object, opts) + if err != nil && !isErrObjectNotFound(err) && !isErrVersionNotFound(err) { + objInfo.Name = decodeDirObject(object) + return objInfo, err + } + if err == nil { + objInfo.Name = decodeDirObject(object) + return objInfo, nil + } + } + objInfo.Name = decodeDirObject(object) - return objInfo, err + if opts.VersionID != "" { + return objInfo, VersionNotFound{Bucket: bucket, Object: object, VersionID: opts.VersionID} + } + return objInfo, ObjectNotFound{Bucket: bucket, Object: object} } func (z *erasureServerPools) deleteObjectFromAllPools(ctx context.Context, bucket string, object string, opts ObjectOptions, poolIndices []poolErrs) (objInfo ObjectInfo, err error) { @@ -1291,19 +1312,20 @@ func (z *erasureServerPools) DeleteObjects(ctx context.Context, bucket string, o go func(idx int, pool *erasureSets) { defer wg.Done() objs := poolObjIdxMap[idx] - if len(objs) > 0 { - orgIndexes := origIndexMap[idx] - deletedObjects, errs := pool.DeleteObjects(ctx, bucket, objs, opts) - mu.Lock() - for i, derr := range errs { - if derr != nil { - derrs[orgIndexes[i]] = derr - } - deletedObjects[i].ObjectName = decodeDirObject(deletedObjects[i].ObjectName) - dobjects[orgIndexes[i]] = deletedObjects[i] + if len(objs) == 0 { + return + } + orgIndexes := origIndexMap[idx] + deletedObjects, errs := pool.DeleteObjects(ctx, bucket, objs, opts) + mu.Lock() + for i, derr := range errs { + if derr != nil { + derrs[orgIndexes[i]] = derr } - mu.Unlock() + deletedObjects[i].ObjectName = decodeDirObject(deletedObjects[i].ObjectName) + dobjects[orgIndexes[i]] = deletedObjects[i] } + mu.Unlock() }(idx, pool) } wg.Wait()