zitadel/internal/eventstore/repository
Tim Möhlmann d4389ab359
feat(eventstore): add row locking option (#8939)
# Which Problems Are Solved

We need a reliable way to lock events that are being processed as part
of a job queue. For example in the notification handlers.

# How the Problems Are Solved

Allow setting `FOR UPDATE [ NOWAIT | SKIP LOCKED ]` to the eventstore
query builder using an open transaction.

- NOWAIT returns an errors if the lock cannot be obtained
- SKIP LOCKED only returns row which are not locked.
- Default is to wait for the lock to be released.

# Additional Changes

- none

# Additional Context

- [Locking
docs](https://www.postgresql.org/docs/17/sql-select.html#SQL-FOR-UPDATE-SHARE)
- Related to https://github.com/zitadel/zitadel/issues/8931
2024-11-21 14:46:30 +00:00
..
mock perf(milestones): refactor (#8788) 2024-10-28 08:29:34 +00:00
sql feat(eventstore): add row locking option (#8939) 2024-11-21 14:46:30 +00:00
asset.go feat: add assets to eventstore and event (#1674) 2021-04-27 12:58:18 +02:00
event.go fix(eventstore): revert precise decimal (#8527) (#8679) 2024-09-24 18:43:29 +02:00
search_query_test.go feat(eventstore): increase parallel write capabilities (#5940) 2023-10-19 12:19:10 +02:00
search_query.go feat(eventstore): add row locking option (#8939) 2024-11-21 14:46:30 +00:00