Ghost/core/server
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
..
adapters Switch to @tryghost/errors from ignition errors package (#13807) 2021-12-01 10:22:01 +00:00
api Added 'content-version' header response 2022-04-08 20:41:54 +12:00
data Added type column to members_paid_subscription_events (#14432) 2022-04-07 11:29:14 +01:00
lib Updated probe-image-size options to reflect underlying change 2022-03-09 20:27:38 +00:00
models Added support for 'FOR UPDATE' lock (#14433) 2022-04-08 12:52:33 +01:00
services Added MRR stats service and endpoint (#14427) 2022-04-08 09:18:04 +02:00
views Updated unsubscribe page 2022-03-10 10:39:20 +00:00
web Added MRR stats service and endpoint (#14427) 2022-04-08 09:18:04 +02:00
analytics-events.js Added comments to all usages of lib/common/events 2021-07-07 16:02:44 +01:00
ghost-server.js Switch to @tryghost/errors from ignition errors package (#13807) 2021-12-01 10:22:01 +00:00
notify.js Removed unused import 2021-12-06 08:17:07 +00:00
overrides.js Set global Luxon timezone override to UTC 2021-10-20 09:19:29 +02:00
run-update-check.js Revert "Revert "Extract logging from DI patterns, only use @tryghost/logging package"" (#13884) 2021-12-14 11:22:39 +00:00
update-check.js Added library for extracting database information 2022-01-18 09:31:08 +00:00