From aa1252d687ec037df78c3801ccb3f981c4fd99cd Mon Sep 17 00:00:00 2001 From: John Spray Date: Mon, 18 Dec 2023 19:52:16 +0000 Subject: [PATCH] compute_tools: enable passing through stripe size --- compute_tools/src/config.rs | 11 +++++++++++ libs/compute_api/src/spec.rs | 3 +++ 2 files changed, 14 insertions(+) diff --git a/compute_tools/src/config.rs b/compute_tools/src/config.rs index a7ef8cea92..852f98de96 100644 --- a/compute_tools/src/config.rs +++ b/compute_tools/src/config.rs @@ -69,6 +69,17 @@ pub fn write_postgres_conf( )?; } + if let Some(stripe_size) = &spec.shard_stripe_size { + writeln!( + file, + "neon.stripe_size={}", + // TODO: postgres should take stripe size in page count, to match how the + // rest of the system stores it. + // https://github.com/neondatabase/neon/pull/5837#discussion_r1430485706 + (stripe_size * 8 * 1024) / (1024 * 1024) + )?; + } + match spec.mode { ComputeMode::Primary => {} ComputeMode::Static(lsn) => { diff --git a/libs/compute_api/src/spec.rs b/libs/compute_api/src/spec.rs index 2a483188e4..53144c03db 100644 --- a/libs/compute_api/src/spec.rs +++ b/libs/compute_api/src/spec.rs @@ -73,6 +73,9 @@ pub struct ComputeSpec { // information about available remote extensions pub remote_extensions: Option, + + // Stripe size for pageserver sharding, in pages + pub shard_stripe_size: Option, } /// Feature flag to signal `compute_ctl` to enable certain experimental functionality.