mirror of
https://github.com/minio/minio.git
synced 2025-03-30 17:23:42 -04:00
treat 0-byte objects to honor same quorum as delete marker (#17633)
on unversioned buckets its possible that 0-byte objects might lose quorum on flaky systems, allow them to be same as DELETE markers. Since practically speak they have no content.
This commit is contained in:
parent
f6040dffaf
commit
a566bcf613
3
.github/workflows/helm-lint.yml
vendored
3
.github/workflows/helm-lint.yml
vendored
@ -14,9 +14,6 @@ concurrency:
|
|||||||
permissions:
|
permissions:
|
||||||
contents: read
|
contents: read
|
||||||
|
|
||||||
permissions:
|
|
||||||
contents: read
|
|
||||||
|
|
||||||
jobs:
|
jobs:
|
||||||
release:
|
release:
|
||||||
runs-on: ubuntu-latest
|
runs-on: ubuntu-latest
|
||||||
|
2
.github/workflows/vulncheck.yml
vendored
2
.github/workflows/vulncheck.yml
vendored
@ -20,7 +20,7 @@ jobs:
|
|||||||
- name: Set up Go
|
- name: Set up Go
|
||||||
uses: actions/setup-go@v3
|
uses: actions/setup-go@v3
|
||||||
with:
|
with:
|
||||||
go-version: 1.19.10
|
go-version: 1.19.11
|
||||||
check-latest: true
|
check-latest: true
|
||||||
- name: Get official govulncheck
|
- name: Get official govulncheck
|
||||||
run: go install golang.org/x/vuln/cmd/govulncheck@latest
|
run: go install golang.org/x/vuln/cmd/govulncheck@latest
|
||||||
|
@ -350,8 +350,11 @@ func findFileInfoInQuorum(ctx context.Context, metaArr []FileInfo, modTime time.
|
|||||||
for _, part := range meta.Parts {
|
for _, part := range meta.Parts {
|
||||||
fmt.Fprintf(h, "part.%d", part.Number)
|
fmt.Fprintf(h, "part.%d", part.Number)
|
||||||
}
|
}
|
||||||
fmt.Fprintf(h, "%v+%v", meta.Erasure.DataBlocks, meta.Erasure.ParityBlocks)
|
|
||||||
fmt.Fprintf(h, "%v", meta.Erasure.Distribution)
|
if !meta.Deleted && meta.Size != 0 {
|
||||||
|
fmt.Fprintf(h, "%v+%v", meta.Erasure.DataBlocks, meta.Erasure.ParityBlocks)
|
||||||
|
fmt.Fprintf(h, "%v", meta.Erasure.Distribution)
|
||||||
|
}
|
||||||
|
|
||||||
// ILM transition fields
|
// ILM transition fields
|
||||||
fmt.Fprint(h, meta.TransitionStatus)
|
fmt.Fprint(h, meta.TransitionStatus)
|
||||||
@ -499,7 +502,8 @@ func listObjectParities(partsMetadata []FileInfo, errs []error) (parities []int)
|
|||||||
parities[index] = -1
|
parities[index] = -1
|
||||||
continue
|
continue
|
||||||
}
|
}
|
||||||
if metadata.Deleted {
|
// Delete marker or zero byte objects take highest parity.
|
||||||
|
if metadata.Deleted || metadata.Size == 0 {
|
||||||
parities[index] = len(partsMetadata) / 2
|
parities[index] = len(partsMetadata) / 2
|
||||||
} else {
|
} else {
|
||||||
parities[index] = metadata.Erasure.ParityBlocks
|
parities[index] = metadata.Erasure.ParityBlocks
|
||||||
|
@ -278,6 +278,11 @@ func (er erasureObjects) GetObjectNInfo(ctx context.Context, bucket, object stri
|
|||||||
return gr.WithCleanupFuncs(nsUnlocker), nil
|
return gr.WithCleanupFuncs(nsUnlocker), nil
|
||||||
}
|
}
|
||||||
|
|
||||||
|
if objInfo.Size == 0 {
|
||||||
|
// Zero byte objects don't even need to further initialize pipes etc.
|
||||||
|
return NewGetObjectReaderFromReader(bytes.NewReader(nil), objInfo, opts)
|
||||||
|
}
|
||||||
|
|
||||||
fn, off, length, err := NewGetObjectReader(rs, objInfo, opts)
|
fn, off, length, err := NewGetObjectReader(rs, objInfo, opts)
|
||||||
if err != nil {
|
if err != nil {
|
||||||
return nil, err
|
return nil, err
|
||||||
|
Loading…
x
Reference in New Issue
Block a user