-
Notifications
You must be signed in to change notification settings - Fork 87
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Reduce likelihood of contention in transactions #814
Comments
Notes regarding early locking with Early ISA subscription lockingInteractions with NetRID's ISAs might benefit from having a method like SCD's LockSubscriptionsOnCells for RID subscriptions. Ie, the cells for which rid subscriptions are updated with UpdateNotificationIdxInCells could be locked early. NotesAn alternative to having an early locking method would be to run the index-incrementing query earlier when certain operations are done. For example, in InsertISA or UpdateISA, once the query is determined to be valid, We could also try this approach with the OIR handlers: instead of calling LockSubscriptionsOnCells we could directly call the query incrementing indices? Here I am assuming that locking records and actually updating them has a comparable cost: if it is the case, we might be able to save a round-trip to CRDB and make OIR upserts even faster? Early subscription locking for OIR deletionAs a sidenote, for OIRs, |
@BenjaminPelletier, before I go one with adding optional "FOR UPDATE" to various requests, may I ask you to check #1117 and confirm that this is the approach you were thinking off? |
Currently, there are circumstances when many transactions may fundamentally contend to change the same data fields. Specifically, if there are many flights being updated in the same area at the same time, the notification indices for each flight's associated subscription will need to be updated for each change to a flight in the area. We can reduce the likelihood of a deadlock or poor database behavior in two ways:
SELECT FOR UPDATE
SQL command where appropriateThe text was updated successfully, but these errors were encountered: