-
Notifications
You must be signed in to change notification settings - Fork 53
Description
In the Redis documentation the following remark is stated:
If the command is sent as part of a MULTI transaction (since Redis 7.0, any context that does not allow blocking, such as inside scripts), the command does not block but instead just return ASAP the number of replicas that acknowledged the previous write commands.
We currently do this in an attempt to implement a best-effort approach for consistency in Sentinel setups. This can be found in the Redis documentation. If the command does not block in MULTI until the write is acknowledged by two replicas, then the WAIT has little effect. Therefore, we should consider checking the number of replicas the WAIT command returns and implement an alternative flow if the number is less than 2.
If this change is considered to have a too small effect, then the WAIT commands might be superfluous at all.
Examples of places where the WAIT command is called:
irmago/server/irmaserver/sessions.go
Line 275 in 52fd9f2
| if err := s.client.Wait(ctx, 1, time.Second).Err(); err != nil { |
irmago/server/irmaserver/sessions.go
Line 352 in 52fd9f2
| if err := tx.Wait(ctx, 1, time.Second).Err(); err != nil { |
| if err := tx.Wait(ctx, 1, time.Second).Err(); err != nil { |
| if err := tx.Wait(ctx, 1, time.Second).Err(); err != nil { |