Skip to content

Commit

Permalink
core: remove "file name too long" limitation
Browse files Browse the repository at this point in the history
* part two, prev. commit: 1aed15f

Signed-off-by: Alex Aizman <[email protected]>
  • Loading branch information
alex-aizman committed Jan 8, 2025
1 parent 1aed15f commit 6603f24
Show file tree
Hide file tree
Showing 9 changed files with 41 additions and 44 deletions.
12 changes: 1 addition & 11 deletions ais/tgtimpl.go
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
// Package ais provides core functionality for the AIStore object storage.
/*
* Copyright (c) 2018-2024, NVIDIA CORPORATION. All rights reserved.
* Copyright (c) 2018-2025, NVIDIA CORPORATION. All rights reserved.
*/
package ais

Expand Down Expand Up @@ -63,16 +63,6 @@ func (t *target) PutObject(lom *core.LOM, params *core.PutParams) error {
debug.Assert(params.WorkTag != "" && !params.Atime.IsZero())
workFQN := fs.CSM.Gen(lom, fs.WorkfileType, params.WorkTag)

// TODO -- FIXME: should it stay "short" in memory?
if lom.IsFntl() {
var (
short = lom.ShortenFntl()
saved = lom.PushFntl(short)
)
lom.SetCustomKey(cmn.OrigFntl, saved[0])
workFQN = fs.CSM.Gen(lom, fs.WorkfileType, params.WorkTag)
}

poi := allocPOI()
{
poi.t = t
Expand Down
13 changes: 12 additions & 1 deletion ais/tgtobj.go
Original file line number Diff line number Diff line change
Expand Up @@ -178,8 +178,19 @@ func (poi *putOI) do(resphdr http.Header, r *http.Request, dpq *dpq) (int, error
}

func (poi *putOI) putObject() (ecode int, err error) {
if lom := poi.lom; lom.IsFntl() {
// override wfqn and shorten (!) lom, both
var (
short = lom.ShortenFntl()
saved = lom.PushFntl(short)
)
lom.SetCustomKey(cmn.OrigFntl, saved[0])
poi.workFQN = fs.CSM.Gen(lom, fs.WorkfileType, "fntl-0x24")
}

poi.ltime = mono.NanoTime()
// PUT is a no-op if the checksums do match

// if checksums match PUT is a no-op
if !poi.skipVC && !poi.coldGET {
if poi.lom.EqCksum(poi.cksumToUse) {
if cmn.Rom.FastV(4, cos.SmoduleAIS) {
Expand Down
2 changes: 1 addition & 1 deletion ais/tgts3mpt.go
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
// Package ais provides core functionality for the AIStore object storage.
/*
* Copyright (c) 2018-2024, NVIDIA CORPORATION. All rights reserved.
* Copyright (c) 2018-2025, NVIDIA CORPORATION. All rights reserved.
*/
package ais

Expand Down
2 changes: 1 addition & 1 deletion cmd/authn/aisreq.go
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
// Package authn is authentication server for AIStore.
/*
* Copyright (c) 2018-2024, NVIDIA CORPORATION. All rights reserved.
* Copyright (c) 2018-2025, NVIDIA CORPORATION. All rights reserved.
*/
package main

Expand Down
2 changes: 1 addition & 1 deletion cmn/objattrs.go
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
// Package cmn provides common constants, types, and utilities for AIS clients
// and AIStore.
/*
* Copyright (c) 2018-2024, NVIDIA CORPORATION. All rights reserved.
* Copyright (c) 2018-2025, NVIDIA CORPORATION. All rights reserved.
*/
package cmn

Expand Down
9 changes: 6 additions & 3 deletions cmn/objlist_utils.go
Original file line number Diff line number Diff line change
Expand Up @@ -270,13 +270,13 @@ const (
cusdlm = ' ' // k1:v1 k2:v2
)

// set by the backend.PutObj()
// see also: DelStdCustom()
var (
stdCustomProps = [...]string{SourceObjMD, ETag, LastModified, CRC32CObjMD, MD5ObjMD, VersionObjMD}
)

// (compare w/ CustomProps2S below)
// [NOTE]
// - usage: LOM custom metadata => LsoEnt custom property
// - `OrigFntl` always excepted (and possibly other TBD internal keys)
func CustomMD2S(md cos.StrKVs) string {
var (
sb strings.Builder
Expand All @@ -303,6 +303,9 @@ func CustomMD2S(md cos.StrKVs) string {
if l > 0 {
// add remaining (non-standard) attr-s in an arbitrary sorting order
for k, v := range md {
if k == OrigFntl {
continue
}
if cos.StringInSlice(k, stdCustomProps[:]) {
continue
}
Expand Down
2 changes: 1 addition & 1 deletion cmn/ver_const.go
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
// Package cmn provides common constants, types, and utilities for AIS clients
// and AIStore.
/*
* Copyright (c) 2022-2024, NVIDIA CORPORATION. All rights reserved.
* Copyright (c) 2022-2025, NVIDIA CORPORATION. All rights reserved.
*/
package cmn

Expand Down
12 changes: 5 additions & 7 deletions core/lom.go
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
// Package core provides core metadata and in-cluster API
/*
* Copyright (c) 2018-2024, NVIDIA CORPORATION. All rights reserved.
* Copyright (c) 2018-2025, NVIDIA CORPORATION. All rights reserved.
*/
package core

Expand Down Expand Up @@ -428,7 +428,7 @@ func (lom *LOM) Load(cacheit, locked bool) error {
return err
}
if lom.bid() == 0 {
// NOTE: always zero - not storing it with MetaverLOM = 1
// NOTE: always zero (MetaverLOM = 1: not storing the BID part of the lom.md.lid)
lom.setbid(lom.Bprops().BID)
}

Expand All @@ -442,7 +442,7 @@ func (lom *LOM) Load(cacheit, locked bool) error {
return nil
}

func (lom *LOM) _checkBucket(bmd *meta.BMD) (err error) {
func (lom *LOM) _checkBucket(bmd *meta.BMD) error {
bck := &lom.bck
bprops, present := bmd.Get(bck)
if !present {
Expand All @@ -451,12 +451,10 @@ func (lom *LOM) _checkBucket(bmd *meta.BMD) (err error) {
}
return cmn.NewErrBckNotFound(bck.Bucket())
}
// TODO -- FIXME: lom.bid() is 52 bits, bprops.BID is not
// (see core/meta/bid.go)
if lom.bid() != bprops.BID {
err = cmn.NewErrObjDefunct(lom.String(), lom.bid(), bprops.BID)
return cmn.NewErrObjDefunct(lom.String(), lom.bid(), bprops.BID)
}
return err
return nil
}

// usage: fast (and unsafe) loading object metadata except atime - no locks
Expand Down
31 changes: 13 additions & 18 deletions xact/xs/wi_lso.go
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
// Package xs contains most of the supported eXtended actions (xactions) with some
// exceptions that include certain storage services (mirror, EC) and extensions (downloader, lru).
/*
* Copyright (c) 2018-2024, NVIDIA CORPORATION. All rights reserved.
* Copyright (c) 2018-2025, NVIDIA CORPORATION. All rights reserved.
*/
package xs

Expand Down Expand Up @@ -90,7 +90,18 @@ func (wi *walkInfo) match(objName string) bool {
// new entry to be added to the listed page (note: slow path)
func (wi *walkInfo) ls(lom *core.LOM, status uint16) (e *cmn.LsoEnt) {
e = &cmn.LsoEnt{Name: lom.ObjName, Flags: status | apc.EntryIsCached}
if wi.msg.IsFlagSet(apc.LsVerChanged) {

if lom.IsFntl() {
orig := lom.OrigFntl()
if orig != nil {
saved := lom.PushFntl(orig)
if wi.msg.IsFlagSet(apc.LsVerChanged) {
checkRemoteMD(lom, e)
}
lom.PopFntl(saved)
e.Name = orig[1]
}
} else if wi.msg.IsFlagSet(apc.LsVerChanged) {
checkRemoteMD(lom, e)
}
if wi.msg.IsFlagSet(apc.LsNameOnly) {
Expand All @@ -108,22 +119,6 @@ func checkRemoteMD(lom *core.LOM, e *cmn.LsoEnt) {
case res.Eq:
debug.AssertNoErr(res.Err)
case cos.IsNotExist(res.Err, res.ErrCode):
if lom.IsFntl() {
orig := lom.OrigFntl()
if orig != nil {
saved := lom.PushFntl(orig)
res = lom.CheckRemoteMD(false, false, nil)
lom.PopFntl(saved)
if res.Eq {
e.Name = orig[1]
break
}
if !cos.IsNotExist(res.Err, res.ErrCode) {
e.SetVerChanged()
break
}
}
}
e.SetVerRemoved()
default:
e.SetVerChanged()
Expand Down

0 comments on commit 6603f24

Please sign in to comment.