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] Maintain a lookup index in Log metadata for replicated loglets #2230

Merged
merged 3 commits into from
Nov 8, 2024

Conversation

AhmedSoliman
Copy link
Contributor

@AhmedSoliman AhmedSoliman commented Nov 7, 2024

This introduces a lookup table to find replicated loglets by id in Log metadata. This also promotes replicated loglet as a core feature in restate-types since it'll become the default soon.

In future follow-up we can explore deserializing the loglet params prematurely (or use typed structure instead of string) and maintain reference-counted container to avoid memory bloat. In this PR, we treat replicated loglet as a special case to speed up implementation and since this will be the de-facto loglet provider anyway.

Stack created with Sapling. Best reviewed with ReviewStack.

Copy link

github-actions bot commented Nov 7, 2024

Test Results

  7 files  ±0    7 suites  ±0   4m 29s ⏱️ -1s
 47 tests ±0   46 ✅ ±0  1 💤 ±0  0 ❌ ±0 
182 runs  ±0  179 ✅ ±0  3 💤 ±0  0 ❌ ±0 

Results for commit 6d59731. ± Comparison against base commit 7a28dad.

♻️ 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.

LGTM. +1 for merging.

#[derive(Debug, Clone)]
pub struct LogletRef<P> {
pub params: P,
pub references: SmallVec<[(LogId, SegmentIndex); 1]>,
Copy link
Contributor

Choose a reason for hiding this comment

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

Is it a SmallVec to prepare for a future where we are sharing loglets between different logs (e.g. when splitting)?

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Yes.

MetadataContainer enum was ~450 bytes and it's being used often. It also forces users to clone input which is not great. The PR contains mostly mechanical changes.
This introduces a lookup table to find replicated loglets by id in Log metadata. This also promotes replicated loglet as a core feature in restate-types since it'll become the default soon.


In future follow-up we can explore deserializing the loglet params prematurely (or use typed structure instead of string) and maintain reference-counted container to avoid memory bloat. In this PR, we treat replicated loglet as a special case to speed up implementation and since this will be the de-facto loglet provider anyway.
@AhmedSoliman AhmedSoliman merged commit 6d59731 into main Nov 8, 2024
22 of 23 checks passed
@AhmedSoliman AhmedSoliman deleted the pr2230 branch November 8, 2024 15:52
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