From 44b34299a8647b14f5d3d2df64423eec55c180b4 Mon Sep 17 00:00:00 2001 From: Ishaan Jaff Date: Wed, 2 Apr 2025 23:14:55 -0700 Subject: [PATCH] docs db deadlocks --- docs/my-website/docs/proxy/db_deadlocks.md | 9 +++++++++ 1 file changed, 9 insertions(+) diff --git a/docs/my-website/docs/proxy/db_deadlocks.md b/docs/my-website/docs/proxy/db_deadlocks.md index 51052a0bc59..e649bdccc0f 100644 --- a/docs/my-website/docs/proxy/db_deadlocks.md +++ b/docs/my-website/docs/proxy/db_deadlocks.md @@ -31,6 +31,15 @@ Each instance writes updates to redis A single instance will acquire a lock on the DB and flush all elements in the redis queue to the DB. +- 1 instance will attempt to acquire the lock for the DB update job +- The status of the lock is stored in redis +- If the instance acquires the lock to write to DB + - It will read all updates from redis + - Aggregate all updates into 1 transaction + - Write updates to DB + - Release the lock +- Note: Only 1 instance can acquire the lock at a time, this limits the number of instances that can write to the DB at once +