Skip to content

Conversation

@chrisburr
Copy link
Member

Replace temp table approach with SELECT FOR UPDATE SKIP LOCKED for sandbox cleanup. Process batches in parallel with configurable max_workers (default 10). Delete from S3 first, then DB (orphaned DB records cleaned up on next run). Distributes DB load across smaller batches instead of one large delete at the end.

Replace the temp table approach with SELECT FOR UPDATE SKIP LOCKED
to allow concurrent cleanup workers on MySQL. Each batch now:
1. Selects and locks rows
2. Deletes from S3
3. Deletes from DB

Multiple workers process batches in parallel within a single call,
and multiple instances of clean_sandboxes can also run concurrently.
This distributes the DB load across smaller batches instead of one
large delete at the end.
@read-the-docs-community
Copy link

Documentation build overview

📚 diracx | 🛠️ Build #31073897 | 📁 Comparing 2ca93a4 against latest (6525e65)


🔍 Preview build

Show files changed (1 files in total): 📝 1 modified | ➕ 0 added | ➖ 0 deleted
File Status
admin/reference/values/index.html 📝 modified

@chrisburr chrisburr marked this pull request as ready for review January 20, 2026 13:38
@chrisburr
Copy link
Member Author

I've hotfixed this in LHCb and it seems to be working well.

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.

1 participant