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

feat(remote_wal): implement topic allocation #2970

Merged
merged 10 commits into from
Dec 22, 2023
Merged

Conversation

niebayes
Copy link
Contributor

@niebayes niebayes commented Dec 20, 2023

I hereby agree to the terms of the GreptimeDB CLA

What's changed and what's your intention?

  • Implemented Kafka topic manager and topic selector to support allocating kafka wal topics.
  • Implemented WalOptionsAllocator so wal options could be allocated while the metasrv is handling a create table request.

TODO

  • Integration test to check the topic manager could successfully contact kafka cluster and create topics.

Checklist

  • I have written the necessary rustdoc comments.
  • I have added the necessary unit tests and integration tests.

Refer to a related PR or issue link (optional)

Tracing issue for Kafka remote wal: #2722

Copy link

codecov bot commented Dec 20, 2023

Codecov Report

Attention: 116 lines in your changes are missing coverage. Please review.

Comparison is base (43f01cc) 85.90% compared to head (43e514c) 85.80%.
Report is 1 commits behind head on develop.

Additional details and impacted files
@@             Coverage Diff             @@
##           develop    #2970      +/-   ##
===========================================
- Coverage    85.90%   85.80%   -0.10%     
===========================================
  Files          780      780              
  Lines       125900   126088     +188     
===========================================
+ Hits        108157   108195      +38     
- Misses       17743    17893     +150     

src/common/meta/src/wal/kafka/topic_manager.rs Outdated Show resolved Hide resolved
src/common/meta/src/wal/kafka/topic_manager.rs Outdated Show resolved Hide resolved
src/common/meta/src/wal/kafka/topic_selector.rs Outdated Show resolved Hide resolved
src/common/meta/src/wal/kafka/topic_selector.rs Outdated Show resolved Hide resolved
src/common/meta/src/wal/kafka/topic_selector.rs Outdated Show resolved Hide resolved
src/common/meta/src/wal/options_allocator.rs Outdated Show resolved Hide resolved
src/common/meta/src/error.rs Outdated Show resolved Hide resolved
src/common/meta/src/error.rs Outdated Show resolved Hide resolved
src/common/meta/src/wal/kafka/topic_manager.rs Outdated Show resolved Hide resolved
src/common/meta/src/wal/kafka/topic_manager.rs Outdated Show resolved Hide resolved
src/common/meta/src/wal/kafka/topic_selector.rs Outdated Show resolved Hide resolved
src/common/meta/src/wal/options_allocator.rs Outdated Show resolved Hide resolved
src/common/meta/src/wal/options_allocator.rs Show resolved Hide resolved
src/common/meta/src/wal/kafka/topic_manager.rs Outdated Show resolved Hide resolved
src/common/meta/src/wal/kafka/topic_selector.rs Outdated Show resolved Hide resolved
src/common/meta/src/wal/kafka/topic_selector.rs Outdated Show resolved Hide resolved
src/common/meta/src/wal/kafka/topic_manager.rs Outdated Show resolved Hide resolved
src/common/meta/src/wal/kafka/topic_manager.rs Outdated Show resolved Hide resolved
src/common/meta/src/wal/kafka/topic_manager.rs Outdated Show resolved Hide resolved
src/common/meta/src/wal/kafka/topic_manager.rs Outdated Show resolved Hide resolved
src/common/meta/src/wal/kafka/topic_selector.rs Outdated Show resolved Hide resolved
src/common/meta/src/error.rs Outdated Show resolved Hide resolved
src/common/meta/src/error.rs Outdated Show resolved Hide resolved
src/common/meta/src/error.rs Outdated Show resolved Hide resolved
src/common/meta/src/error.rs Outdated Show resolved Hide resolved
src/common/meta/src/error.rs Outdated Show resolved Hide resolved
src/common/meta/src/error.rs Outdated Show resolved Hide resolved
src/common/meta/src/error.rs Outdated Show resolved Hide resolved
src/common/meta/src/error.rs Outdated Show resolved Hide resolved
src/common/meta/src/wal/kafka/topic_manager.rs Outdated Show resolved Hide resolved
@niebayes niebayes requested a review from WenyXu December 22, 2023 07:57
Copy link
Contributor

@killme2008 killme2008 left a comment

Choose a reason for hiding this comment

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

LGTM

@niebayes niebayes enabled auto-merge December 22, 2023 08:16
@niebayes niebayes added this pull request to the merge queue Dec 22, 2023
@niebayes niebayes added the docs-not-required This change does not impact docs. label Dec 22, 2023
Merged via the queue into develop with commit 830a91c Dec 22, 2023
25 checks passed
@niebayes niebayes deleted the feat/impl_topic_manager branch December 22, 2023 08:42
# Number of partitions per topic.
# num_partitions = 1
# Expected number of replicas of each partition.
# replication_factor = 3
# Above which a topic creation operation will be cancelled.
Copy link
Member

Choose a reason for hiding this comment

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

Let's use more concise words.

Nit(Non-blocking):

Suggested change
# Above which a topic creation operation will be cancelled.
# The timeout of topic creation

Comment on lines +202 to +204
if let Err(e) = self.wal_options_allocator.start().await {
error!(e; "Failed to start wal options allocator");
}
Copy link
Member

Choose a reason for hiding this comment

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

Nit(Non-blocking):
We should ensure the start will only be executed once in the life cycle. We can improve this in the future.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
docs-not-required This change does not impact docs.
Projects
None yet
Development

Successfully merging this pull request may close these issues.

8 participants