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

[Bifrost] RepairTail task for replicated loglet #2046

Merged
merged 1 commit into from
Oct 11, 2024
Merged

[Bifrost] RepairTail task for replicated loglet #2046

merged 1 commit into from
Oct 11, 2024

Conversation

AhmedSoliman
Copy link
Contributor

@AhmedSoliman AhmedSoliman commented Oct 9, 2024

This puts together the design and implementation of the tail repair procedure that's required when FindTail cannot establish a consistent durable tail from log-servers. The details are described as comments in code.

Stack created with Sapling. Best reviewed with ReviewStack.

Copy link

github-actions bot commented Oct 9, 2024

Test Results

  5 files  ±0    5 suites  ±0   2m 43s ⏱️ -4s
 45 tests ±0   45 ✅ ±0  0 💤 ±0  0 ❌ ±0 
114 runs  ±0  114 ✅ ±0  0 💤 ±0  0 ❌ ±0 

Results for commit 516c026. ± Comparison against base commit ef3ffc4.

♻️ This comment has been updated with latest results.

@AhmedSoliman AhmedSoliman changed the title [WIP] RepairTail [Bifrost] RepairTail task for replicated loglet Oct 10, 2024
@AhmedSoliman AhmedSoliman force-pushed the pr2046 branch 2 times, most recently from 037e92b to 351371b Compare October 10, 2024 12:34
@AhmedSoliman AhmedSoliman marked this pull request as ready for review October 10, 2024 12:34
@AhmedSoliman AhmedSoliman force-pushed the pr2046 branch 2 times, most recently from e11e1f9 to 1392f17 Compare October 10, 2024 13:41
@AhmedSoliman AhmedSoliman mentioned this pull request Oct 10, 2024
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.

Great work @AhmedSoliman 🚀 The changes look really good and the logic seems sound to me. +1 for merging :-)

Comment on lines +227 to +229
// We run stores as tasks because we'll wait only for the necessary write-quorum but the
// rest of the stores can continue in the background as best-effort replication (if the
// spread selector strategy picked extra nodes)
Copy link
Contributor

Choose a reason for hiding this comment

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

Unrelated: Can it become a problem if we accumulate network send tasks that are awaiting a response which won't come because the other node has died? I don't expect this to happen often but over time it could result into a memory leak.

Copy link
Contributor Author

Choose a reason for hiding this comment

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

The task will give up once it exhausts our rpc retry policy (which is finite by default) but the risk exists if someone changed this to infinite retries.

/// 1. Log-servers persisting the last known_global_tail periodically/async and using this value as known_global_tail on startup.
/// 2. Sequencer-driven seal. If the sequencer is alive, it can send a special value with the seal message to
/// indicate what is the ultimate known-global-tail that nodes should repair to instead of relying on the observed max-tail.
/// 3. Limit `from_offset` to repair from to max(min(local_tails), max(known_global_tails), known_archived, trim_point)
Copy link
Contributor

Choose a reason for hiding this comment

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

Why could we take the min of local tails? Wouldn't this run the risk to lose previously committed records?

Copy link
Contributor Author

Choose a reason for hiding this comment

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

This implies that those tails are from f-majority of nodes. If we have responses of f-majority of log-servers.

Copy link
Contributor

Choose a reason for hiding this comment

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

Maybe you can explain this optimization to me once we have a bit more time after the demo. I can't wrap my head around it yet. The only thing I can think of is that we can skip those entries where we can reliably say that even with the missing nodes, there can't be a write quorum.

This puts together the design and implementation of the tail repair procedure that's required when FindTail cannot establish a consistent durable tail from log-servers. The details are described as comments in code.
@AhmedSoliman AhmedSoliman merged commit 516c026 into main Oct 11, 2024
16 of 17 checks passed
@AhmedSoliman AhmedSoliman deleted the pr2046 branch October 11, 2024 12:59
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