Skip to content

sbellware/account-basics-concurrent-write-proof

Repository files navigation

Reproduction steps

  1. Perform database setup and get dependencies:
./script/setup.sh
  1. Start message consumer process:
./start-service.sh
  1. Start one of message producers:
./script/produce-messages_1_long_transactions.sh
./script/produce-messages_2_batches_in_contention.sh
./script/produce-messages_3_message_in_contention.sh
  1. Verify if number of Deposit messages equals number of Deposited. If not, you've experienced race condition in get_category_messages
psql message_store < check_messages.sql

Reproduction on video

The example illustrating long transactions (highest chance of race condition):

The example illustraing uneven but short transactions (batches of 1-2 messages):

The example illustrating most typical usage under high load:

The problem exposed by the experiments:

transactions_and_ids

In such case we can get IDs of events 0 and 2, but skip reading uncommitted event nr 1.

About

No description, website, or topics provided.

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published