Scalable log replay in `ZooKeeperCommandExecutor`
Nobody has claimed this yet.
- Dominant language
- Java
- Stars
- 668
- Forks
- 135
- Avg merge
- 4d 19h
- Merged PRs (30d)
- 7
Description
`ZooKeeperCommandExecutor` stores and replays replication logs sequentially. `replayLogs()` method, which replays the replication logs, acquires an exclusive lock via `synchronized` keyword to ensure the sequential replay.
However, some commands can be replayed in parallel. For example:
- `SessionCommand`s can be replayed in parallel with other command types.
- `CreateSessionCommand` and `RemoveSessionCommand` must be executed in order, though.
- All other commands can be replayed in parallel as long as they are for the different projects from each other. (We could expand this to repository-level, but it's probably an overkill.)
Contributor guide
First steps
- Read the whole issue, then the project's contributing guide.
- Comment on the issue to say you are picking it up — it saves two people doing the same work.
- Fork the repository and make your change on a branch.
- Open a pull request that references the issue number.
Research direction
Start with the `ZooKeeperCommandExecutor` class and its `replayLogs()` method to understand the current sequential replay and locking behavior. Define and implement safe parallelism while preserving ordering for `CreateSessionCommand` and `RemoveSessionCommand`, and isolating other commands by project; done means replay remains correct under these constraints.
Written by the indexing model from the issue text.
Assessment
- Tech stack
- java
- Domain
- distributed-systems
- Issue type
- Feature
- Difficulty
- 5/5
- Estimated time
- Over a week
- Activity status
- Stale
- Clarity
- Mostly clear
- Newbie friendliness
- 30/100