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

chore(attachmentStorage): Update sync management command to support no lock during execution #5307

Merged
merged 1 commit into from
Nov 27, 2024

Conversation

noliveleger
Copy link
Contributor

📣 Summary

Added an option to the update_attachment_storage_bytes management command to prevent user submission suspension. Updated logic to handle the submissions_suspended flag conditionally.

📖 Description

This PR updates the update_attachment_storage_bytes management command to support a "no lock" mode. Previously, the command would set the submissions_suspended flag to True during its execution, preventing users from submitting data until the process was complete.
Introduced a new argument/option to skip toggling the submissions_suspended flag.
Default behavior (suspending submissions) remains unchanged to avoid breaking existing workflows.
When the "no lock" option is enabled, the command synchronizes attachment storage without blocking user submissions.

The {"no_lock": true} option can now be passed to the sync_storage_counters periodic task (if it was previously added).
If sync_storage_counters has already been added as a periodic task, you should also add fix_stale_submissions_suspended_flag to ensure that accidentally locked accounts are unlocked.

💭 Notes

⚠️ Using no_lock option could result in discrepancies since submissions could continue to come in while the process is still counting storage usage.

@noliveleger noliveleger self-assigned this Nov 27, 2024
Copy link

Copy link
Contributor

@rajpatel24 rajpatel24 left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM

Copy link
Contributor

@rajpatel24 rajpatel24 left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM

@noliveleger noliveleger merged commit 0f1275b into release/2.024.33 Nov 27, 2024
7 checks passed
@noliveleger noliveleger deleted the task-1302-sync-counter-lock-users branch November 27, 2024 19:04
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants