diff --git a/src/cmd/src/metasrv.rs b/src/cmd/src/metasrv.rs index 3cc0468069..c0714b82ea 100644 --- a/src/cmd/src/metasrv.rs +++ b/src/cmd/src/metasrv.rs @@ -340,12 +340,12 @@ impl StartCommand { .await .context(StartMetaServerSnafu)?; - let builder = meta_srv::bootstrap::metasrv_builder(&opts, plugins.clone(), None) + let builder = meta_srv::bootstrap::metasrv_builder(&opts, plugins, None) .await .context(error::BuildMetaServerSnafu)?; let metasrv = builder.build().await.context(error::BuildMetaServerSnafu)?; - let instance = MetasrvInstance::new(opts, plugins, metasrv) + let instance = MetasrvInstance::new(metasrv) .await .context(error::BuildMetaServerSnafu)?; diff --git a/src/meta-srv/src/bootstrap.rs b/src/meta-srv/src/bootstrap.rs index 7ab4f09e61..af6be556ae 100644 --- a/src/meta-srv/src/bootstrap.rs +++ b/src/meta-srv/src/bootstrap.rs @@ -95,11 +95,10 @@ pub struct MetasrvInstance { } impl MetasrvInstance { - pub async fn new( - opts: MetasrvOptions, - plugins: Plugins, - metasrv: Metasrv, - ) -> Result { + pub async fn new(metasrv: Metasrv) -> Result { + let opts = metasrv.options().clone(); + let plugins = metasrv.plugins().clone(); + let builder = HttpServerBuilder::new(opts.http.clone()) .with_metrics_handler(MetricsHandler) .with_greptime_config_options(opts.to_toml().context(error::TomlFormatSnafu)?); diff --git a/src/mito2/src/memtable.rs b/src/mito2/src/memtable.rs index 6fb1457ed3..ca23570f09 100644 --- a/src/mito2/src/memtable.rs +++ b/src/mito2/src/memtable.rs @@ -98,6 +98,12 @@ impl MemtableStats { self } + #[cfg(feature = "test")] + pub fn with_max_sequence(mut self, max_sequence: SequenceNumber) -> Self { + self.max_sequence = max_sequence; + self + } + /// Returns the estimated bytes allocated by this memtable. pub fn bytes_allocated(&self) -> usize { self.estimated_bytes