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): introduce region meta and integrate it into creating table metadata #2830

Closed
wants to merge 5 commits into from

Conversation

niebayes
Copy link
Contributor

I hereby agree to the terms of the GreptimeDB CLA

What's changed and what's your intention?

  • Define a RegionMeta to store per-region unique metadata. Currently, it stores per-region unique wal metadata which is stored in RegionWalMeta.
  • Add RegionMeta in DatanodeTableValue and integrate persisting region metas into creating table metadata.
  • Update tests accordingly.

This PR is part of the Kafka Remote Wal project. With this feature, the TableMetadataAllocator is able to allocate per-region unique metadata while handling create table requests. The allocated metadata will be persisted during creating table metadata by the procedure manager. On the other hand, a datanode is able to fetch regions' unique metadata during initializing region servers, so that regions can be opened properly.

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)

#2753
#2816

@niebayes niebayes self-assigned this Nov 28, 2023
src/common/meta/src/key/datanode_table.rs Show resolved Hide resolved
src/common/meta/src/key/datanode_table.rs Show resolved Hide resolved
/// A region's unique wal metadata.
// FIXME(niebayes): Shall String or RegionWalMetaKey be used as the key type?
#[derive(Default, Debug, Serialize, Deserialize, Clone, PartialEq)]
pub struct RegionWalMeta(HashMap<String, String>);
Copy link
Member

Choose a reason for hiding this comment

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

Suggested change
pub struct RegionWalMeta(HashMap<String, String>);
pub type RegionWalMeta = HashMap<String, String>;

src/common/meta/src/region_meta/wal_meta.rs Show resolved Hide resolved

use crate::region_meta::wal_meta::RegionWalMeta;

/// Stores a region's unique metadata. Any common metadata or options among regions shall not be stored in the struct.
Copy link
Member

@WenyXu WenyXu Nov 28, 2023

Choose a reason for hiding this comment

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

Suggested change
/// Stores a region's unique metadata. Any common metadata or options among regions shall not be stored in the struct.
/// Stores a region's unique metadata. Any common metadata or options among regions should not be stored in the struct.

@niebayes niebayes marked this pull request as draft December 14, 2023 02:48
@niebayes niebayes closed this Dec 15, 2023
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.

4 participants