-
Notifications
You must be signed in to change notification settings - Fork 328
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
feat(remote_wal): add skeleton for remote wal related to meta srv #2933
Merged
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
8 tasks
niebayes
requested review from
WenyXu,
killme2008,
MichaelScofield,
v0y4g3r,
evenyag and
waynexia
December 14, 2023 07:48
Codecov Report
Additional details and impacted files@@ Coverage Diff @@
## develop #2933 +/- ##
===========================================
+ Coverage 85.12% 85.79% +0.67%
===========================================
Files 756 767 +11
Lines 120101 123627 +3526
===========================================
+ Hits 102232 106065 +3833
+ Misses 17869 17562 -307 |
WenyXu
reviewed
Dec 19, 2023
MichaelScofield
approved these changes
Dec 19, 2023
WenyXu
approved these changes
Dec 19, 2023
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Rest LGTM
killme2008
reviewed
Dec 19, 2023
niebayes
force-pushed
the
feat/remote_wal_skeleton_meta_srv
branch
from
December 19, 2023 09:07
bf2e93d
to
cd1afdd
Compare
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.
I hereby agree to the terms of the GreptimeDB CLA
What's changed and what's your intention?
The remote wal project involves modifying a bunch of codes and I've observed that reviewers are finding it challenging to grasp the overall scope of the remote wal project. This PR is proposed to try to speed up the review process.
Details
We are designing a
WalOptions
that stores wal options allocated at the granularity of a region.We are designing a
WalOptionsAllocator
for the granular allocation of wal options based on regions. It internally maintains aKafkaTopicManager
for allocating Kafka wal topics if the allocator is of typeWalOptionsAllocator::Kafka
. For efficiency, this allocator also supports batch allocation of wal options.The
KafkaTopicManager
primarily consists of a topic pool and a topic selector.When the Meta srv starts, we initialize the
WalOptionsAllocator
. It is then maintained by theTableMetadataAllocator
in theDdlManager
.When handling a create table request, the
create
interface of theTableMetadataAllocator
in theDdlManager
is called. At this point, we invoke theWalOptionsAllocator
to allocate wal options for each region of the table. The allocated wal options are passed to the procedure manager and used during the execution of the create table operation.We modify
DatanodeTableValue
to include awal_options_map
field, of typeHashMap<RegionNumber, EncodedWalOptions>
, representing the wal options allocated for each region of a table. When persisting the metadata of a table, the procedure manager also persists the wal options. TheEncodedWalOptions
is simply a string.When the Datanode starts, it reads the persisted
DatanodeTableValue
from the kv backend, retrieves thewal_options_map
, decodes and extracts the wal options for each region. These wal options are stored inRegionOpenRequest
for use when opening a region.Checklist
Refer to a related PR or issue link (optional)