citusdata / citusdata/citus

Improve locking semantics for UPDATE / UPSERT / DELETE

Open
#370 6 comments 0 reactions 0 assignees View on GitHub
1-2 weeks
Dominant language
C
Stars
12.8k
Forks
794
Avg merge
2d 14h
Merged PRs (30d)
31

Description

When the master node receives an `UPDATE`, and has default config settings, it acquires an exclusive lock on the shard id. This leads to a notable performance degradation for `UPDATE`, `INSERT ... ON CONFLICT UPDATE`, and `DELETE` statements.

If the user enables `all_modifications_commutative`, we instead acquire a shared lock.

This issue relates to investigating and implementing a locking policy that improves performance for `UPDATE` statements.

Contributor guide

Open the contributing guide

Research direction

No files or tests are named. Start by tracing how the master node locks the shard id for UPDATE, INSERT ... ON CONFLICT UPDATE, and DELETE, then compare the default behavior with all_modifications_commutative. Done means a defined locking policy is implemented and its correctness and performance are validated.

Written by the indexing model from the issue text.

Assessment

Tech stack
c, postgresql
Domain
databases, distributed-systems, performance
Issue type
Feature
Difficulty
5/5
Estimated time
Over a week
Activity status
Stale
Clarity
Needs clarification
Newbie friendliness
25/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.