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

Fix speed up disk quota computation PR #4476

Draft
wants to merge 1 commit into
base: master
Choose a base branch
from
Draft
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
11 changes: 4 additions & 7 deletions .github/workflows/test.yml
Original file line number Diff line number Diff line change
Expand Up @@ -102,8 +102,7 @@ jobs:
strategy:
matrix:
test:
- disk
- unittest gen-rest-docs gen-cli-docs gen-readthedocs basic auth status batch anonymous competition unicode rest1 upload1 upload2 upload3 upload4 download
- unittest gen-rest-docs gen-cli-docs gen-readthedocs basic auth status batch anonymous competition unicode rest1 upload1 upload2 upload3 upload4 download disk
- refs binary rm make worksheet_search worksheet_tags bundle_freeze_unfreeze worksheet_freeze_unfreeze detach perm search_time groups
- worker_manager service
- run time
Expand Down Expand Up @@ -290,8 +289,7 @@ jobs:
strategy:
matrix:
test:
- disk
- basic status batch anonymous unicode rest1 upload1 download
- basic status batch anonymous unicode rest1 upload1 download disk
- refs binary rm make worksheet_search worksheet_tags bundle_freeze_unfreeze worksheet_freeze_unfreeze detach perm search_time groups
- run
- search read kill write mimic workers
Expand Down Expand Up @@ -503,8 +501,7 @@ jobs:
strategy:
matrix:
test:
- disk
- unittest gen-rest-docs gen-cli-docs gen-readthedocs basic auth status batch anonymous competition unicode rest1 upload1 upload2 upload3 upload4 download
- unittest gen-rest-docs gen-cli-docs gen-readthedocs basic auth status batch anonymous competition unicode rest1 upload1 upload2 upload3 upload4 download disk
- refs binary rm make worksheet_search worksheet_tags bundle_freeze_unfreeze worksheet_freeze_unfreeze detach perm search_time groups
- worker_manager service
- run time
Expand Down Expand Up @@ -620,4 +617,4 @@ jobs:
needs: [format, install, test_frontend, build, test_backend, test_backend_on_worker_restart, test_backend_sharedfs, test_backend_protected_mode, test_ui]
steps:
- uses: actions/checkout@v3
- run: echo Done
- run: echo Done
3 changes: 2 additions & 1 deletion codalab/rest/bundles.py
Original file line number Diff line number Diff line change
Expand Up @@ -1349,6 +1349,7 @@ def delete_bundles(uuids, force, recursive, data_only, dry_run):
)

# cache these so we have them even after the metadata for the bundle has been deleted
bundle_owner_ids = local.model.get_bundle_owner_ids(relevant_uuids)
bundle_data_sizes = local.model.get_bundle_metadata(relevant_uuids, 'data_size')
bundle_locations = {
uuid: local.bundle_store.get_bundle_location(uuid) for uuid in relevant_uuids
Expand Down Expand Up @@ -1382,7 +1383,7 @@ def delete_bundles(uuids, force, recursive, data_only, dry_run):
# Update user disk used.
if removed and uuid in bundle_data_sizes:
local.model.increment_user_disk_used(
request.user.user_id, -int(bundle_data_sizes[uuid])
bundle_owner_ids[uuid], -int(bundle_data_sizes[uuid])
)
return relevant_uuids

Expand Down