gitforge/services
Gusted a85d9b2b52 feat: make delete repository transcation READ COMMITTED (#12856)
This is a monster transaction, it touches a lot of tables and happily
locks many rows which results in all other operations waiting on this
transaction to finish. In a lot of cases this operation is fast and for
many this wouldn't be a problem, however on Codeberg we've observed that
when large (many issues, comments and PRs specifically) repository is
being deleted it can result in the instance being unreachable to do any
other modification to it.

This is not fixable for SQLite (although if you get such large
repositories and has many concurrent writes, then maybe SQLite is no
longer a good choice) as transactions are always of the SERIALIZABLE
level.

PostgreSQL default isolation level is READ COMMITTED and seems to me
the observed behavior on Codeberg wouldn't happen here unless the
default isolation level is to be made REPEATABLE READ or SERIALIZABLE.

MySQL/MariaDB default isolation level is REPEATABLE READ and that gets
the behavior of rows being locked (even those that aren't being
modified). And this is where this patch is effective to make this
transaction a bit less of a monster.

There's a small risk of making this transaction READ COMMITTED, there's
a window where new records can be created for this repository which will
then not be deleted. These will eventually be solved by foreign keys,
currently most can still be removed after the fact by the
`check-db-consistency` doctor check.

Reviewed-on: https://codeberg.org/forgejo/forgejo/pulls/12856
Reviewed-by: Mathieu Fenniak <mfenniak@noreply.codeberg.org>
2026-07-07 21:56:18 +02:00
..
actions feat(actions): add support for using workflow run-name as run title (#13114) 2026-07-03 16:45:39 +02:00
agit
asymkey
attachment
auth chore: add more error output for an invalid JWT key identifier (#12903) 2026-06-02 23:39:51 +02:00
authz feat: enable auth to git LFS via authorized integrations (#12725) 2026-05-28 23:20:58 +02:00
automerge
context Update module github.com/go-chi/chi/v5 to v5.3.0 (forgejo) (#12697) 2026-06-29 23:35:12 +02:00
contexttest chore(refactor): add getter/setter to APIContext data members (#13143) 2026-06-27 02:53:45 +02:00
convert chore(refactor): add getter/setter to APIContext data members (#13143) 2026-06-27 02:53:45 +02:00
cron
doctor fix(doctor): ensure the doctor runs with the same settings.AppPath as Forgejo (#12901) 2026-06-06 03:23:06 +02:00
externalaccount
f3
federation
feed
forgejo
forms fix(ui): fall back to default theme from non-existent (#13110) 2026-06-17 19:18:09 +02:00
gitdiff chore: bump golangci-lint version (#13211) 2026-06-27 00:35:03 +02:00
indexer
issue feat: add internal APIs for reactions notifications (#13017) 2026-06-29 03:59:39 +02:00
lfs 2026-06-10 security patches (#13001) 2026-06-10 06:05:01 +02:00
mailer fix: add extraLinesCount to reply template (#13258) 2026-07-04 05:02:28 +02:00
markup
migrations fix: ensure migrations allow/deny host lists are applied to onedev, pagure, and codebase migrators (#13184) 2026-06-25 14:11:36 +02:00
mirror fix: compliance with [migrations].ALLOWED_DOMAINS, ...BLOCKED_DOMAINS, and ....ALLOW_LOCALNETWORKS for git & LFS ops (#13129) 2026-06-23 23:40:25 +02:00
moderation
notify feat: add internal APIs for reactions notifications (#13017) 2026-06-29 03:59:39 +02:00
org feat: make delete repository transcation READ COMMITTED (#12856) 2026-07-07 21:56:18 +02:00
packages chore: move determinePackageAccessMode from context packages 2026-06-20 06:24:07 +02:00
pull fix: ignore migrated commit without a patch (#13257) 2026-07-03 03:38:52 +02:00
redirect
release
remote
repository feat: make delete repository transcation READ COMMITTED (#12856) 2026-07-07 21:56:18 +02:00
secrets
shared/automerge
stats
task
uinotification
user fix: cascade deletion of a user to their authorized integrations (#13323) 2026-07-06 15:05:11 +02:00
webhook feat: Update Microsoft Teams webhook to use AdaptiveCard (#11704) 2026-05-26 16:10:55 +02:00
wiki