Skip to content

Commit

Permalink
feat: add open candidate region state
Browse files Browse the repository at this point in the history
  • Loading branch information
WenyXu committed Nov 17, 2023
1 parent a2cba0f commit 861369d
Show file tree
Hide file tree
Showing 3 changed files with 487 additions and 4 deletions.
9 changes: 8 additions & 1 deletion src/meta-srv/src/procedure/region_migration.rs
Original file line number Diff line number Diff line change
Expand Up @@ -36,6 +36,7 @@ use store_api::storage::RegionId;
use self::migration_start::RegionMigrationStart;
use crate::error::{Error, Result};
use crate::procedure::utils::region_lock_key;
use crate::service::mailbox::MailboxRef;

/// It's shared in each step and available even after recovering.
///
Expand Down Expand Up @@ -77,6 +78,8 @@ pub trait ContextFactory {
pub struct ContextFactoryImpl {
volatile_ctx: VolatileContext,
table_metadata_manager: TableMetadataManagerRef,
mailbox: MailboxRef,
server_addr: String,
}

impl ContextFactory for ContextFactoryImpl {
Expand All @@ -85,6 +88,8 @@ impl ContextFactory for ContextFactoryImpl {
persistent_ctx,
volatile_ctx: self.volatile_ctx,
table_metadata_manager: self.table_metadata_manager,
mailbox: self.mailbox,
server_addr: self.server_addr,
}
}
}
Expand All @@ -96,12 +101,14 @@ pub struct Context {
persistent_ctx: PersistentContext,
volatile_ctx: VolatileContext,
table_metadata_manager: TableMetadataManagerRef,
mailbox: MailboxRef,
server_addr: String,
}

impl Context {
/// Returns address of meta server.
pub fn server_addr(&self) -> &str {
todo!()
&self.server_addr
}
}

Expand Down
Loading

0 comments on commit 861369d

Please sign in to comment.