Ghost/core
Fabien 'egg' O'Carroll 022c8c8e69
Added support for 'FOR UPDATE' lock (#14433)
refs https://github.com/TryGhost/Team/issues/1248

This is the underlying cause of the problems we've seen whilst handling
Stripe webhooks. A transaction ensures that the operations are atomic,
but not that they can run concurrently.

If you have some code which does this, concurrently:
1. Starts a transaction
2. Reads a value
3. Changes the values
4. Ends the transaction

Without applying the `FOR UPDATE` lock - you will have both sequenes
read the same value at step 2.

With the `FOR UPDATE` lock - one of the sequences will hang at step 2,
waiting for the other transaction to end, at which point it will resume
and read the _changed_ value.

Because the `edit` method explicitly does a read followed by a write, we
have also add the `FOR UPDATE` lock to this by default, to avoid any race
conditions. This does however require that `edit` is called within a
transaction. An issue here https://github.com/TryGhost/Team/issues/1503
considers running in a transaction by default.
2022-04-08 12:52:33 +01:00
..
client@ef66ef1403 Updated Admin to v4.42.1 2022-04-04 10:39:50 +01:00
frontend Moved routing helpers to rendering service 2022-04-05 20:12:20 +01:00
server Added support for 'FOR UPDATE' lock (#14433) 2022-04-08 12:52:33 +01:00
shared Wired newsletter preference page in Portal to API 2022-04-05 22:49:09 +05:30
app.js Fixed express app stacking 2021-12-06 21:28:53 +13:00
boot.js Added theme-service-init metric during boot 2022-03-24 09:20:52 +00:00
bridge.js 💡 Pinned frontend API version to canary 2022-02-17 17:55:55 +00:00