Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

add EXTRA_TRAVERSE_WEIGHT_MULTIPLIER environment var #291

Open
wants to merge 1 commit into
base: main
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
1 change: 1 addition & 0 deletions src/dvc_objects/db.py
Original file line number Diff line number Diff line change
Expand Up @@ -433,6 +433,7 @@ def oids_exist(self, oids, jobs=None, progress=noop):
traverse_weight = traverse_pages * self.fs.TRAVERSE_WEIGHT_MULTIPLIER
else:
traverse_weight = traverse_pages
traverse_weight *= self.fs.EXTRA_TRAVERSE_WEIGHT_MULTIPLIER
if len(oids) < traverse_weight and not always_traverse:
logger.debug(
"Large remote (%r oids < %r traverse weight), "
Expand Down
3 changes: 3 additions & 0 deletions src/dvc_objects/fs/base.py
Original file line number Diff line number Diff line change
Expand Up @@ -69,6 +69,9 @@ class FileSystem:
HASH_JOBS = max(1, min(4, cpu_count() // 2))
LIST_OBJECT_PAGE_SIZE = 1000
TRAVERSE_WEIGHT_MULTIPLIER = 5
EXTRA_TRAVERSE_WEIGHT_MULTIPLIER = int(
os.getenv("EXTRA_TRAVERSE_WEIGHT_MULTIPLIER", "1")
)
TRAVERSE_PREFIX_LEN = 2
TRAVERSE_THRESHOLD_SIZE = 500000
CAN_TRAVERSE = True
Expand Down