storj/storagenode/gracefulexit
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
..
blobscleaner.go all: fix error checking 2020-07-16 19:13:14 +03:00
chore_test.go satellite/audit,storagenode/gracefulexit: fixes to limiter 2022-08-03 10:24:16 +03:00
chore.go storagenode/gracefulexit: remove unused interface 2022-08-04 11:26:14 +03:00
common.go storagenode/gracefulexit: retry workers faster 2020-08-24 12:27:27 +03:00
db_test.go all: fix dots 2020-07-16 14:58:28 +00:00
endpoint_test.go storagenode/internalpb: move gracefulexit.proto 2020-10-30 15:24:56 +02:00
endpoint.go pb: use *UnimplementedServer to avoid breaking API changes 2021-03-29 12:26:10 +03:00
service.go storage/filestore: avoid stat() during walkNamespaceInPath 2023-01-30 13:47:03 +00:00
worker_test.go {satellite,storagenode}/gracefulexit: simplify limiter usage 2022-08-04 08:18:15 +00:00
worker.go storagenode/gracefulexit: remove unused interface 2022-08-04 11:26:14 +03:00