mirror of
https://github.com/zitadel/zitadel.git
synced 2025-08-11 20:27:32 +00:00
fix(fields): await running queries during trigger (#8391)
# Which Problems Are Solved During triggering of the fields table WriteTooOld errors can occure when using cockroachdb. # How the Problems Are Solved The statements exclusively lock the projection before they start to insert data by using `FOR UPDATE`.
This commit is contained in:
@@ -113,6 +113,8 @@ func (h *FieldHandler) processEvents(ctx context.Context, config *triggerConfig)
|
|||||||
}
|
}
|
||||||
}()
|
}()
|
||||||
|
|
||||||
|
// always await currently running transactions
|
||||||
|
config.awaitRunning = true
|
||||||
currentState, err := h.currentState(ctx, tx, config)
|
currentState, err := h.currentState(ctx, tx, config)
|
||||||
if err != nil {
|
if err != nil {
|
||||||
if errors.Is(err, errJustUpdated) {
|
if errors.Is(err, errJustUpdated) {
|
||||||
|
Reference in New Issue
Block a user