Skip to content

[HDDS-15069] design doc to introduce and describe OM multiraft feature - #10103

Open
vtutrinov wants to merge 5 commits into
apache:masterfrom
vtutrinov:HDDS-15069-om-multi-raft-design-doc
Open

[HDDS-15069] design doc to introduce and describe OM multiraft feature#10103
vtutrinov wants to merge 5 commits into
apache:masterfrom
vtutrinov:HDDS-15069-om-multi-raft-design-doc

Conversation

@vtutrinov

Copy link
Copy Markdown
Contributor

What changes were proposed in this pull request?

Design doc for OM multiraft feature

What is the link to the Apache JIRA

https://issues.apache.org/jira/browse/HDDS-15069

How was this patch tested?

NA

#### Assignment Metadata

The bucket-to-group assignment is stored:
1. **In Bucket Metadata** (RocksDB): Each bucket stores its assigned RAFT group ID

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

what if some poweruser grow one bucket to very large?

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

The bucket (BucketInfo's representation in Rocks) stores only GUID of the related raft group, not a huge amount of data. But the current design doc does not address the problem of concentrating write requests within a single RAFT group when users of the ozone cluster use the same bucket, and millions of write requests would hit the same bucket state machine. As a Phase 2, I suggest rewriting the router that selects the raft group to handle the write requests and allow it to handle a huge amount of requests within multiple RAFT groups

@ivandika3
ivandika3 self-requested a review April 22, 2026 01:21
@vtutrinov
vtutrinov force-pushed the HDDS-15069-om-multi-raft-design-doc branch from 3fd291f to 91644c1 Compare April 27, 2026 10:05
@github-actions

Copy link
Copy Markdown

This PR has been marked as stale due to 21 days of inactivity. Please comment or remove the stale label to keep it open. Otherwise, it will be automatically closed in 7 days.

@github-actions github-actions Bot added the stale label May 31, 2026
@vtutrinov

Copy link
Copy Markdown
Contributor Author

review is in progress

@github-actions github-actions Bot removed the stale label Jun 1, 2026
@github-actions

Copy link
Copy Markdown

This PR has been marked as stale due to 21 days of inactivity. Please comment or remove the stale label to keep it open. Otherwise, it will be automatically closed in 7 days.

@github-actions github-actions Bot added the stale label Jun 22, 2026
@vtutrinov

Copy link
Copy Markdown
Contributor Author

review is in progress

@ivandika3 ivandika3 left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@vtutrinov I had a incomplete review, but let me share it first.

Comment on lines +313 to +338
public class OmRaftGroupsLeadershipBalancer {

/**
* Ensures RAFT group leaders are distributed across OM nodes.
* Target: Each OM node should be leader for ~equal number of groups.
*/
public void balanceLeadership() {
Map<String, Integer> nodeToLeaderCount = getCurrentLeaderDistribution();

// If imbalance detected (max - min > threshold)
if (isImbalanced(nodeToLeaderCount)) {
// Transfer leadership from overloaded to underloaded nodes
for (RaftGroupId group : getOverloadedGroups()) {
String targetNode = selectUnderloadedNode();
transferLeadership(group, targetNode);
}
}
}
}
```

**Balancer Strategy**:
- Runs periodically (default: every 5 minutes)
- Transfers leadership via RAFT `transferLeadership()` API
- Considers node health and load
- Graceful transfers to avoid disruption

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Which OM node is running this?

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

a leader node of the main raft group

Comment on lines +34 to +37
The multi-raft architecture partitions buckets write request across a configurable number of RAFT groups (default: 6). Each RAFT group:
- Has its own RAFT leader, followers, and log
- Processes write requests independently and in parallel
- Uses the same OM nodes but with different leaders

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

The main concern is that although we shard the buckets namespace to multiple Raft groups, we are still using one underlying OM DB.

For example, what happens if the leader of Raft group 2 sends a notifyInstallSnapshot to follower? Currently, this requires the follower to download the OM DB and all AppendEntries will be rejected. Can I check what is the expected behavior for this?

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

For now (in MVP), a snapshot installation for a specific state machine could corrupt the trxId<->raftLogIndex state of other raft groups. Suggest per-node (not per-group) sync of the state machines (pause all state machines, sync, unpause) as an initial step (Phase 1) and separation of per-group DB or column families state as a Phase 2. A new commit with the suggestion above is ready

@github-actions github-actions Bot removed the stale label Jun 23, 2026
…ible resolutions - per-group snapshot installation could corrupt other groups states
@github-actions

Copy link
Copy Markdown

This PR has been marked as stale due to 21 days of inactivity. Please comment or remove the stale label to keep it open. Otherwise, it will be automatically closed in 7 days.

@szetszwo szetszwo left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@vtutrinov , Thanks for submitting the design! Have two questions inlined.

BTW, we should just have a high level design first. Details like confs and code can be added later. A shorter design doc is easier to be reviewed and get approved.


Ratis snapshot and install-snapshot assume a **1:1 relationship between a Raft log
and the persisted state** it protects. The multi-raft design breaks that assumption:
there are `N` bucket RAFT groups plus the main RAFT group, but they all apply into a

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

The term "main RAFT group" appears the first time here. What is it and why it is needed? We should explain it in the High-Level Design section.

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

The definition was added

Ratis snapshot and install-snapshot assume a **1:1 relationship between a Raft log
and the persisted state** it protects. The multi-raft design breaks that assumption:
there are `N` bucket RAFT groups plus the main RAFT group, but they all apply into a
**single shared OM RocksDB**. This means a snapshot taken for one group, and an

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Should we use multiple OM RocksDBs?

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Sounds like a good idea (at least it's worth comparing a number of implementations and choosing the best one based on performance and maintainability); it's already described and suggested in the following section (take a look at Future direction: per-group state isolation (Phase 2))

@vtutrinov

Copy link
Copy Markdown
Contributor Author

@vtutrinov , Thanks for submitting the design! Have two questions inlined.

BTW, we should just have a high level design first. Details like confs and code can be added later. A shorter design doc is easier to be reviewed and get approved.

Done. Remove the code and conf examples

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

Projects

None yet

Development

Successfully merging this pull request may close these issues.

5 participants