Skip to content

Feat: move database vacuum to aggregator startup to avoid API interruptions during epoch transitions #2375

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

Merged

Conversation

dlachaume
Copy link
Collaborator

@dlachaume dlachaume commented Mar 17, 2025

Content

This PR includes a fix for the API unavailability during epoch transitions by moving database vacuum operation from the upkeep service to aggregator startup.

The main changes are:

  • Removed vacuum operation from the epoch transition process
  • Created a VacuumTracker utility that tracks when the last vacuum operation was performed
  • Added a controlled vacuum process at aggregator startup with a minimum interval (1 week)
  • Added a clap command to execute vacuum manually

Pre-submit checklist

  • Branch
    • Tests are provided (if possible)
    • Crates versions are updated (if relevant)
    • CHANGELOG file is updated (if relevant)
    • Commit sequence broadly makes sense
    • Key commits have useful messages
  • PR
    • All check jobs of the CI have succeeded
    • Self-reviewed the diff
    • Useful pull request description
    • Reviewer requested
  • Documentation
    • Update README file (if relevant)
    • Update documentation website (if relevant)
    • Add dev blog post (if relevant)
    • Add ADR blog post or Dev ADR entry (if relevant)
    • No new TODOs introduced

Issue(s)

Closes #2364

@dlachaume dlachaume self-assigned this Mar 17, 2025
Copy link

github-actions bot commented Mar 17, 2025

Test Results

    3 files  ±0     56 suites  ±0   11m 42s ⏱️ +5s
1 765 tests +8  1 765 ✅ +8  0 💤 ±0  0 ❌ ±0 
2 163 runs  +8  2 163 ✅ +8  0 💤 ±0  0 ❌ ±0 

Results for commit 8730458. ± Comparison against base commit 53e6d45.

♻️ This comment has been updated with latest results.

@dlachaume dlachaume temporarily deployed to testing-preview March 17, 2025 15:17 — with GitHub Actions Inactive
@dlachaume dlachaume force-pushed the dlachaume/2364/avoid-database-vacuum-blocking-aggregator-api branch from 087c436 to 92e845a Compare March 17, 2025 15:23
@dlachaume dlachaume temporarily deployed to testing-preview March 17, 2025 15:31 — with GitHub Actions Inactive
@dlachaume dlachaume force-pushed the dlachaume/2364/avoid-database-vacuum-blocking-aggregator-api branch from 92e845a to b5e416f Compare March 17, 2025 15:38
@dlachaume dlachaume marked this pull request as ready for review March 17, 2025 15:39
@dlachaume dlachaume temporarily deployed to testing-preview March 17, 2025 15:47 — with GitHub Actions Inactive
Copy link
Collaborator

@sfauvel sfauvel left a comment

Choose a reason for hiding this comment

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

LGTM

@dlachaume dlachaume temporarily deployed to testing-preview March 17, 2025 16:28 — with GitHub Actions Inactive
Copy link
Member

@jpraynaud jpraynaud left a comment

Choose a reason for hiding this comment

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

LGTM 👍

@dlachaume dlachaume force-pushed the dlachaume/2364/avoid-database-vacuum-blocking-aggregator-api branch from 8decd2f to 8730458 Compare March 18, 2025 08:21
@dlachaume dlachaume temporarily deployed to testing-preview March 18, 2025 08:29 — with GitHub Actions Inactive
@dlachaume dlachaume merged commit 6408d5c into main Mar 18, 2025
36 checks passed
@dlachaume dlachaume deleted the dlachaume/2364/avoid-database-vacuum-blocking-aggregator-api branch March 18, 2025 08:47
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Database vacuum is blocking aggregator API at epoch transition
4 participants