Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[5/n] New domain-aware nodeset selector #2530

Merged
merged 1 commit into from
Jan 24, 2025
Merged

[5/n] New domain-aware nodeset selector #2530

merged 1 commit into from
Jan 24, 2025

Conversation

Copy link

github-actions bot commented Jan 22, 2025

Test Results

  7 files  ±0    7 suites  ±0   4m 7s ⏱️ + 1m 19s
 47 tests +2   46 ✅ +2  1 💤 ±0  0 ❌ ±0 
182 runs  +8  179 ✅ +8  3 💤 ±0  0 ❌ ±0 

Results for commit 75640b7. ± Comparison against base commit 94be2a4.

♻️ This comment has been updated with latest results.

Copy link
Contributor

@tillrohrmann tillrohrmann left a comment

Choose a reason for hiding this comment

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

Impressive work @AhmedSoliman. From what I can tell, the algorithm looks correct. I left my usual typo comments since I couldn't make any more meaningful contributions. +1 for merging :-)

crates/types/src/replication/nodeset_selector.rs Outdated Show resolved Hide resolved
Self {
hashing_id: 0,
target_size: 0,
salt: 14712721395741015273,
Copy link
Contributor

Choose a reason for hiding this comment

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

Is this your favorite or a random number?

crates/types/src/replication/nodeset_selector.rs Outdated Show resolved Hide resolved
crates/types/src/replication/nodeset_selector.rs Outdated Show resolved Hide resolved
Comment on lines +191 to +192
/// to collect enough nodes that span the widest defined scope in replication property without
/// giving much attention to intermediate levels in the hierarchy. This approach is proven to be
Copy link
Contributor

Choose a reason for hiding this comment

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

So if we define {region: 2, zone: 5, nodes: 5} we don't guarantee that we will replicate across 5 zones, right?

Copy link
Contributor Author

Choose a reason for hiding this comment

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

From nodeset generation perspective, no, but it's up to the spread selector and nodeset checker to enforce that. That said, this will do its absolute best to achieve this if it's possible within the current topology.

.unwrap();

assert!(nodeset.contains(1));
assert_eq!(nodeset.len(), 6);
Copy link
Contributor

Choose a reason for hiding this comment

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

The nodeset size is 6 because we run the choose_domains twice (since all nodes are effectively writable), right?

Copy link
Contributor Author

Choose a reason for hiding this comment

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

It's 6 because we try and get nodes from every domain possible to increase write availability.

// zone-1 N3
//- region1
// zone-0 N1, N4
// zone-1 N1
Copy link
Contributor

Choose a reason for hiding this comment

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

Should N1 be in two zones?

Copy link
Contributor Author

Choose a reason for hiding this comment

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

nope

crates/types/src/replication/nodeset_selector.rs Outdated Show resolved Hide resolved
crates/types/src/replication/nodeset_selector.rs Outdated Show resolved Hide resolved
crates/types/src/replication/nodeset_selector.rs Outdated Show resolved Hide resolved
@AhmedSoliman AhmedSoliman merged commit 75640b7 into main Jan 24, 2025
24 of 25 checks passed
@AhmedSoliman AhmedSoliman deleted the pr2530 branch January 24, 2025 14:54
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants