Tiered objects require ns locks unlike inlined (#18409)

This commit is contained in:
Krishnan Parthasarathi 2023-11-08 20:00:02 -08:00 committed by GitHub
parent 15137d0327
commit 0a25083fdb
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
3 changed files with 11 additions and 2 deletions

View file

@ -22,7 +22,7 @@ jobs:
- name: Set up Go
uses: actions/setup-go@v3
with:
go-version: 1.21.3
go-version: 1.21.4
check-latest: true
- name: Get official govulncheck
run: go install golang.org/x/vuln/cmd/govulncheck@latest

View file

@ -296,7 +296,11 @@ func (fi FileInfo) GetDataDir() string {
// InlineData returns true if object contents are inlined alongside its metadata.
func (fi FileInfo) InlineData() bool {
_, ok := fi.Metadata[ReservedMetadataPrefixLower+"inline-data"]
return ok
// Earlier MinIO versions didn't reset "x-minio-internal-inline-data"
// from fi.Metadata when the object was tiered. So, tiered objects
// would return true for InlineData() in these versions even though the
// object isn't inlined in xl.meta
return ok && !fi.IsRemote()
}
// SetInlineData marks object (version) as inline.

View file

@ -536,6 +536,10 @@ func (j xlMetaV2Object) InlineData() bool {
return ok
}
func (j *xlMetaV2Object) ResetInlineData() {
delete(j.MetaSys, ReservedMetadataPrefixLower+"inline-data")
}
const (
metaTierStatus = ReservedMetadataPrefixLower + TransitionStatus
metaTierObjName = ReservedMetadataPrefixLower + TransitionedObjectName
@ -1440,6 +1444,7 @@ func (x *xlMetaV2) DeleteVersion(fi FileInfo) (string, error) {
err = x.setIdx(i, *ver)
case fi.TransitionStatus == lifecycle.TransitionComplete:
ver.ObjectV2.SetTransition(fi)
ver.ObjectV2.ResetInlineData()
err = x.setIdx(i, *ver)
default:
x.versions = append(x.versions[:i], x.versions[i+1:]...)