From 7b7ab016dbd24841eea77ae66c20c6be1a2e25ba Mon Sep 17 00:00:00 2001 From: Aayush Rajasekaran Date: Tue, 18 Jan 2022 16:35:07 -0500 Subject: [PATCH] create replica update paths in acquireSectors --- extern/sector-storage/ffiwrapper/basicfs/fs.go | 6 ++++++ extern/sector-storage/ffiwrapper/sealer_cgo.go | 4 ++-- 2 files changed, 8 insertions(+), 2 deletions(-) diff --git a/extern/sector-storage/ffiwrapper/basicfs/fs.go b/extern/sector-storage/ffiwrapper/basicfs/fs.go index a833f728c..3d19e49ef 100644 --- a/extern/sector-storage/ffiwrapper/basicfs/fs.go +++ b/extern/sector-storage/ffiwrapper/basicfs/fs.go @@ -34,6 +34,12 @@ func (b *Provider) AcquireSector(ctx context.Context, id storage.SectorRef, exis if err := os.Mkdir(filepath.Join(b.Root, storiface.FTCache.String()), 0755); err != nil && !os.IsExist(err) { // nolint return storiface.SectorPaths{}, nil, err } + if err := os.Mkdir(filepath.Join(b.Root, storiface.FTUpdate.String()), 0755); err != nil && !os.IsExist(err) { // nolint + return storiface.SectorPaths{}, nil, err + } + if err := os.Mkdir(filepath.Join(b.Root, storiface.FTUpdateCache.String()), 0755); err != nil && !os.IsExist(err) { // nolint + return storiface.SectorPaths{}, nil, err + } done := func() {} diff --git a/extern/sector-storage/ffiwrapper/sealer_cgo.go b/extern/sector-storage/ffiwrapper/sealer_cgo.go index e3939d3d1..88ab50f05 100644 --- a/extern/sector-storage/ffiwrapper/sealer_cgo.go +++ b/extern/sector-storage/ffiwrapper/sealer_cgo.go @@ -697,10 +697,10 @@ func (sb *Sealer) ReplicaUpdate(ctx context.Context, sector storage.SectorRef, p if err := os.Mkdir(paths.UpdateCache, 0755); err != nil { // nolint if os.IsExist(err) { - log.Warnf("existing cache in %s; removing", paths.Cache) + log.Warnf("existing cache in %s; removing", paths.UpdateCache) if err := os.RemoveAll(paths.UpdateCache); err != nil { - return empty, xerrors.Errorf("remove existing sector cache from %s (sector %d): %w", paths.Cache, sector, err) + return empty, xerrors.Errorf("remove existing sector cache from %s (sector %d): %w", paths.UpdateCache, sector, err) } if err := os.Mkdir(paths.UpdateCache, 0755); err != nil { // nolint:gosec