apple / apple/foundationdb

Range based locks for fdbdr

Open
#1,044 0 comments 0 reactions 0 assignees View on GitHub
Dominant language
C++
Stars
16.7k
Forks
1.6k
Avg merge
1d 20h
Merged PRs (30d)
126

Description

The current locks for fdbdr lock the entire database. This makes it difficult to have multiple different ranges from different clusters replicated to the same destination.

First we need to separate locks into locks that prevent reading a range and locks that prevent writing a range. When DR is still copying data from the primary we want to prevent both reads and writes. Once the DR database is a full replica of the primary, we only want to prevent writes to the range.

Proposed design:
* Store the locks in the \xff keyspace, and send changes to this list of locks to clients with read version requests.
* Clients check individual reads and writes against the list.

Contributor guide

Open the contributing guide

Research direction

Start by tracing fdbdr's current database-wide locking and how clients receive read version requests. Review the proposed lock list in the \xff keyspace, separating read-blocking and write-blocking ranges, then follow how clients check reads and writes. Done means replication blocks both operations during copying and only writes after the database is a full replica, while supporting different ranges from multiple clusters.

Written by the indexing model from the issue text.

Assessment

Tech stack
cpp
Domain
databases, distributed-systems
Issue type
Feature
Difficulty
5/5
Estimated time
Over a week
Activity status
Stale
Clarity
Mostly clear
Newbie friendliness
25/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.