From 605012f2cdbb0374ce6565cb988e7186237055ee Mon Sep 17 00:00:00 2001 From: Jason Petersen Date: Wed, 10 Jul 2024 07:50:05 -0600 Subject: [PATCH] Ensure OLAP config has enough workers for pg_cron (#867) Co-authored-by: Adam Hendel --- tembo-stacks/Cargo.lock | 2 +- tembo-stacks/Cargo.toml | 2 +- tembo-stacks/src/stacks/config_engines.rs | 6 +++--- 3 files changed, 5 insertions(+), 5 deletions(-) diff --git a/tembo-stacks/Cargo.lock b/tembo-stacks/Cargo.lock index 4665c4e35..ca0fe8eec 100644 --- a/tembo-stacks/Cargo.lock +++ b/tembo-stacks/Cargo.lock @@ -2411,7 +2411,7 @@ dependencies = [ [[package]] name = "tembo-stacks" -version = "0.11.0" +version = "0.11.1" dependencies = [ "anyhow", "clap", diff --git a/tembo-stacks/Cargo.toml b/tembo-stacks/Cargo.toml index 34d76c3b3..3dd28028c 100644 --- a/tembo-stacks/Cargo.toml +++ b/tembo-stacks/Cargo.toml @@ -1,7 +1,7 @@ [package] name = "tembo-stacks" description = "Tembo Stacks for Postgres" -version = "0.11.0" +version = "0.11.1" authors = ["tembo.io"] edition = "2021" license = "Apache-2.0" diff --git a/tembo-stacks/src/stacks/config_engines.rs b/tembo-stacks/src/stacks/config_engines.rs index 8164857ac..238f6ae0c 100644 --- a/tembo-stacks/src/stacks/config_engines.rs +++ b/tembo-stacks/src/stacks/config_engines.rs @@ -168,7 +168,7 @@ fn olap_max_parallel_workers(cpu: f32) -> i32 { } fn olap_max_worker_processes(cpu: f32) -> i32 { - i32::max(1, cpu.round() as i32) + i32::max(1, cpu.round() as i32) + 1 // add one for cron } // olap formula for maintenance_work_mem @@ -535,7 +535,7 @@ mod tests { assert_eq!(configs[5].name, "max_wal_size"); assert_eq!(configs[5].value.to_string(), "2GB"); assert_eq!(configs[6].name, "max_worker_processes"); - assert_eq!(configs[6].value.to_string(), "4"); + assert_eq!(configs[6].value.to_string(), "5"); assert_eq!(configs[7].name, "shared_buffers"); assert_eq!(configs[7].value.to_string(), "4096MB"); assert_eq!(configs[8].name, "work_mem"); @@ -568,7 +568,7 @@ mod tests { assert_eq!(configs[5].name, "max_wal_size"); assert_eq!(configs[5].value.to_string(), "2GB"); assert_eq!(configs[6].name, "max_worker_processes"); - assert_eq!(configs[6].value.to_string(), "1"); + assert_eq!(configs[6].value.to_string(), "2"); assert_eq!(configs[7].name, "shared_buffers"); assert_eq!(configs[7].value.to_string(), "2048MB"); assert_eq!(configs[8].name, "work_mem");