mirror of
https://github.com/neondatabase/neon.git
synced 2026-05-21 07:00:38 +00:00
Add option to disable background_reconcile for storage controller
This commit is contained in:
@@ -75,6 +75,10 @@ struct Cli {
|
||||
#[arg(long)]
|
||||
reconciler_concurrency: Option<usize>,
|
||||
|
||||
/// Whether to spawn a background reconciliation task (enabled by default)
|
||||
#[arg(long)]
|
||||
background_reconcile: Option<bool>,
|
||||
|
||||
/// How long to wait for the initial database connection to be available.
|
||||
#[arg(long, default_value = "5s")]
|
||||
db_connect_timeout: humantime::Duration,
|
||||
@@ -266,6 +270,7 @@ async fn async_main() -> anyhow::Result<()> {
|
||||
reconciler_concurrency: args
|
||||
.reconciler_concurrency
|
||||
.unwrap_or(RECONCILER_CONCURRENCY_DEFAULT),
|
||||
background_reconcile: args.background_reconcile.unwrap_or(true),
|
||||
split_threshold: args.split_threshold,
|
||||
neon_local_repo_dir: args.neon_local_repo_dir,
|
||||
};
|
||||
|
||||
@@ -240,6 +240,8 @@ pub struct Config {
|
||||
/// How many Reconcilers may be spawned concurrently
|
||||
pub reconciler_concurrency: usize,
|
||||
|
||||
pub background_reconcile: bool,
|
||||
|
||||
/// How large must a shard grow in bytes before we split it?
|
||||
/// None disables auto-splitting.
|
||||
pub split_threshold: Option<u64>,
|
||||
@@ -1229,14 +1231,16 @@ impl Service {
|
||||
}
|
||||
});
|
||||
|
||||
tokio::task::spawn({
|
||||
let this = this.clone();
|
||||
let startup_complete = startup_complete.clone();
|
||||
async move {
|
||||
startup_complete.wait().await;
|
||||
this.background_reconcile().await;
|
||||
}
|
||||
});
|
||||
if config.background_reconcile {
|
||||
tokio::task::spawn({
|
||||
let this = this.clone();
|
||||
let startup_complete = startup_complete.clone();
|
||||
async move {
|
||||
startup_complete.wait().await;
|
||||
this.background_reconcile().await;
|
||||
}
|
||||
});
|
||||
}
|
||||
|
||||
tokio::task::spawn({
|
||||
let this = this.clone();
|
||||
|
||||
Reference in New Issue
Block a user