Skip to content

Commit 936aa2f

Browse files
committed
objstorage: minor fixes
1 parent abf3593 commit 936aa2f

File tree

3 files changed

+7
-5
lines changed

3 files changed

+7
-5
lines changed

objstorage/objstorageprovider/remoteobjcat/catalog.go

Lines changed: 2 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -8,7 +8,6 @@ import (
88
"cmp"
99
"fmt"
1010
"io"
11-
"path/filepath"
1211
"slices"
1312
"sync"
1413

@@ -386,8 +385,8 @@ func (c *Catalog) Checkpoint(fs vfs.FS, dir string) error {
386385

387386
// NB: Every write to recWriter is flushed. We don't need to worry about
388387
// this new file descriptor not getting all the saved catalog entries.
389-
existingCatalogFilepath := filepath.Join(c.dirname, c.mu.catalogFilename)
390-
destPath := filepath.Join(dir, c.mu.catalogFilename)
388+
existingCatalogFilepath := c.fs.PathJoin(c.dirname, c.mu.catalogFilename)
389+
destPath := fs.PathJoin(dir, c.mu.catalogFilename)
391390
if err := vfs.CopyAcrossFS(c.fs, existingCatalogFilepath, fs, destPath); err != nil {
392391
return err
393392
}

objstorage/objstorageprovider/vfs.go

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -64,6 +64,8 @@ func (ls *localLockedState) objChanged(meta objstorage.ObjectMetadata) {
6464
if meta.Local.Tier == base.HotTier {
6565
ls.hotTier.objChangeCounter++
6666
} else {
67+
// We dual-write the metadata part of the object.
68+
ls.hotTier.objChangeCounter++
6769
ls.coldTier.objChangeCounter++
6870
}
6971
}

objstorage/remote/localfs.go

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -51,6 +51,7 @@ func (s *localFSStore) ReadObject(
5151
}
5252
stat, err := f.Stat()
5353
if err != nil {
54+
_ = f.Close()
5455
return nil, 0, err
5556
}
5657

@@ -75,9 +76,9 @@ func (r *localFSReader) ReadAt(_ context.Context, p []byte, offset int64) error
7576

7677
// Close is part of the shared.ObjectReader interface.
7778
func (r *localFSReader) Close() error {
78-
r.file.Close()
79+
err := r.file.Close()
7980
r.file = nil
80-
return nil
81+
return err
8182
}
8283

8384
func (f *localFSStore) sync() error {

0 commit comments

Comments
 (0)