Skip to content

Instantly share code, notes, and snippets.

@macdice
Last active July 26, 2016 02:15
Show Gist options
  • Save macdice/23b0aa9e6386e1de2ed3fd00d2ebaa1e to your computer and use it in GitHub Desktop.
Save macdice/23b0aa9e6386e1de2ed3fd00d2ebaa1e to your computer and use it in GitHub Desktop.
tx1: BEGIN;
tx1: update ports dependency data
tx1: trigger sees row in cache_clearing_ports, decides not to insert new one
tx2: BEGIN;
tx2: sees row in cache_clearing_ports, deletes it
tx2: clears the cache
tx2: COMMIT;
external actor: doesn't see tx1, populates cache
tx1: COMMIT;
Now tx1 has committed and the cache has stale data!
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment