-
-
Notifications
You must be signed in to change notification settings - Fork 33
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
Merge JournalManager, FlushManager and WriteBuffer into one FlushTracker #118
Open
hummingly
wants to merge
14
commits into
fjall-rs:main
Choose a base branch
from
hummingly:flush_tracker
base: main
Could not load branches
Branch not found: {{ refName }}
Loading
Could not load tags
Nothing to show
Loading
Are you sure you want to change the base?
Some commits from the old base branch may be removed from the timeline,
and old review comments may become outdated.
+774
−879
Conversation
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
* These data structures are always used together. Grouping them together avoids needless 2 Arc clones and saves 2 words on KeyspaceInner, Monitor and PartitionHandle on the stack. * Removed inner struct variants if the wrapper did not add any functionality. * Simplified item visibility.
* Replaces HashSet/Map with Vec where the results are immediately iterated over or collected into another Vec. The Vecs are guaranteed to be a set due to being derived from HashMaps.
* FlushTracker counter for flush tasks and journal items
marvin-j97
reviewed
Jan 4, 2025
marvin-j97
reviewed
Jan 4, 2025
marvin-j97
reviewed
Jan 5, 2025
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
While I was looking through the codebase to understand how transactions work, I noticed that the KeyspaceInner and PartitionHandleInner structs were somewhat "large". The JournalManager, FlushManager and WriteBuffer were always cloned together so I made the FlushTracker struct and fixed the TODOs in JournalManager and FlushManager. Then I noticed there were some redundant *Inner structs, clones and collects, and went ahead removing them were possible.
The only place I am unsure about is the
SpaceTracker::allocate()
method. In the originalWriteBufferManager::allocate()
methodAtomicU64::fetch_add()
was used. I instead used a loop withAtomicU64::compare_exchange()
.Also I changed some fields to
pub(crate)
frompub
with#[doc(hidden)]
or were otherwise private structs.