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

Adds new command to reset stuck invalidations #23021

Open
wants to merge 2 commits into
base: 5.x-dev
Choose a base branch
from
Open

Conversation

sgiehl
Copy link
Member

@sgiehl sgiehl commented Feb 7, 2025

Description:

Adds a new command to allow administrators to reset stuck invalidations that are incorrectly marked as "in progress."

Stuck invalidations can happen if an archiving process was interrupted, such as during a server crash or deployment, leaving invalidations in a stuck state. Resetting them ensures they can be reprocessed in the next archiving run.

Usage examples:

  • Reset all stuck invalidations for site ID 1 that were started more than an hour ago:
    ./console core:reset-invalidations --idsite=1 --older-than="1 hour ago"

  • Reset invalidations assigned to a specific host:
    ./console core:reset-invalidations --processing-host=archiver1.example.com

  • Perform a dry run to check which invalidations would be reset:
    ./console core:reset-invalidations --idsite=1 --older-than="1 hour ago" --dry-run

  • Reset invalidations for multiple sites and hosts:
    ./console core:reset-invalidations --idsite=1 --idsite=10 --processing-host=archiver1 --processing-host=archiver2

fixes #22971

Review

@sgiehl sgiehl added the Needs Review PRs that need a code review label Feb 7, 2025
@sgiehl sgiehl added this to the 5.3.0 milestone Feb 7, 2025
@sgiehl sgiehl requested a review from a team February 7, 2025 14:03
Copy link
Contributor

@caddoo caddoo left a comment

Choose a reason for hiding this comment

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

I've tested the new addition, and it works as expected nice!

My main concern is test coverage. It looks like the tests focus on failure cases for invalid dates, which is good, and I appreciate the comprehensive testing of the dry-run behavior. However, there isn’t a test that verifies whether the command actually performs the intended action when executed successfully.

I don’t think it's necessary to test every possible path like with the dry run, but at least one test should be added to confirm that the command correctly resets invalidations in a real scenario.

Let me know what you think

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Needs Review PRs that need a code review
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Console Command to Manually Reset Stuck Invalidation Records
2 participants