storj/storagenode/pieces
paul cannon ed7c82439d storage/filestore: avoid stat() during walkNamespaceInPath
Calling stat() (really, lstat()) on every file during a directory walk
is the step that takes up the most time. Furthermore, not all directory
walk uses _need_ to have a stat done on every file. Therefore, in this
commit we avoid doing the stat at the lowest level of
walkNamespaceInPath. The stat will still be done when it is requested,
with the Stat() method on the blobInfo object.

The major upside of this is that we can avoid the stat call on most
files during a Retain operation. This should speed up garbage collection
considerably.

The major downside is that walkNamespaceInPath will no longer
automatically skip over directories that are named like blob files, or
blob files which are deleted between readdir() and stat(). Callers to
walkNamespaceInPath and its variants (WalkNamespace,
WalkSatellitePieces, etc) are now expected to handle these cases
individually.

Thanks to forum member Toyoo for the insight that this would speed up
garbage collection.

Refs: https://github.com/storj/storj/issues/5454
Change-Id: I72930573d58928fa25057ed89cd4ec474b884199
2023-01-30 13:47:03 +00:00
..
cache_test.go storagenode/satellite: support different piece hash algorithms 2022-08-23 18:15:06 +00:00
cache.go storagenode/pieces: allow to configure initial piece scan (#5024) 2022-08-07 22:40:59 +00:00
db_test.go storagenode/storagenodedb/storagenodedbtest: pass ctx as an argument 2020-01-20 16:56:12 +02:00
deleter_test.go storagenode/satellite: support different piece hash algorithms 2022-08-23 18:15:06 +00:00
deleter.go storagenode/pieces: send piece deletions to trash 2021-04-07 16:52:10 +00:00
doc.go storagenode: add doc.go files for sno packages 2021-09-29 08:24:56 +00:00
pieceexpiration_test.go storagenode/storagenodedb/storagenodedbtest: pass ctx as an argument 2020-01-20 16:56:12 +02:00
readwrite_test.go storagenode/satellite: support different piece hash algorithms 2022-08-23 18:15:06 +00:00
readwrite.go storagenode/satellite: support different piece hash algorithms 2022-08-23 18:15:06 +00:00
store_test.go storagenode/piecestore: start restore trash in the background 2022-12-16 18:15:52 +02:00
store.go storage/filestore: avoid stat() during walkNamespaceInPath 2023-01-30 13:47:03 +00:00
trashchore.go storagenode/pieces: fix log line 2023-01-17 11:04:47 +02:00