mirror of
https://github.com/neondatabase/neon.git
synced 2026-05-19 22:20:37 +00:00
storcon: change default stripe size to 16 MB (#11168)
## Problem The current stripe size of 256 MB is a bit large, and can cause load imbalances across shards. A stripe size of 16 MB appears more reasonable to avoid hotspots, although we don't see evidence of this in benchmarks. Resolves https://github.com/neondatabase/cloud/issues/25634. Touches https://github.com/neondatabase/cloud/issues/21870. ## Summary of changes * Change the default stripe size to 16 MB. * Remove `ShardParameters::DEFAULT_STRIPE_SIZE`, and only use `pageserver_api::shard::DEFAULT_STRIPE_SIZE`. * Update a bunch of tests that assumed a certain stripe size.
This commit is contained in:
@@ -800,7 +800,7 @@ impl ComputeHook {
|
||||
|
||||
#[cfg(test)]
|
||||
pub(crate) mod tests {
|
||||
use pageserver_api::shard::{ShardCount, ShardNumber};
|
||||
use pageserver_api::shard::{DEFAULT_STRIPE_SIZE, ShardCount, ShardNumber};
|
||||
use utils::id::TenantId;
|
||||
|
||||
use super::*;
|
||||
@@ -808,6 +808,7 @@ pub(crate) mod tests {
|
||||
#[test]
|
||||
fn tenant_updates() -> anyhow::Result<()> {
|
||||
let tenant_id = TenantId::generate();
|
||||
let stripe_size = DEFAULT_STRIPE_SIZE;
|
||||
let mut tenant_state = ComputeHookTenant::new(
|
||||
TenantShardId {
|
||||
tenant_id,
|
||||
@@ -848,7 +849,7 @@ pub(crate) mod tests {
|
||||
shard_count: ShardCount::new(2),
|
||||
shard_number: ShardNumber(1),
|
||||
},
|
||||
stripe_size: ShardStripeSize(32768),
|
||||
stripe_size,
|
||||
preferred_az: None,
|
||||
node_id: NodeId(1),
|
||||
});
|
||||
@@ -864,7 +865,7 @@ pub(crate) mod tests {
|
||||
shard_count: ShardCount::new(2),
|
||||
shard_number: ShardNumber(0),
|
||||
},
|
||||
stripe_size: ShardStripeSize(32768),
|
||||
stripe_size,
|
||||
preferred_az: None,
|
||||
node_id: NodeId(1),
|
||||
});
|
||||
@@ -874,7 +875,7 @@ pub(crate) mod tests {
|
||||
anyhow::bail!("Wrong send result");
|
||||
};
|
||||
assert_eq!(request.shards.len(), 2);
|
||||
assert_eq!(request.stripe_size, Some(ShardStripeSize(32768)));
|
||||
assert_eq!(request.stripe_size, Some(stripe_size));
|
||||
|
||||
// Simulate successful send
|
||||
*guard = Some(ComputeRemoteState {
|
||||
|
||||
@@ -43,7 +43,7 @@ use pageserver_api::models::{
|
||||
TimelineInfo, TopTenantShardItem, TopTenantShardsRequest,
|
||||
};
|
||||
use pageserver_api::shard::{
|
||||
ShardCount, ShardIdentity, ShardNumber, ShardStripeSize, TenantShardId,
|
||||
DEFAULT_STRIPE_SIZE, ShardCount, ShardIdentity, ShardNumber, ShardStripeSize, TenantShardId,
|
||||
};
|
||||
use pageserver_api::upcall_api::{
|
||||
ReAttachRequest, ReAttachResponse, ReAttachResponseTenant, ValidateRequest, ValidateResponse,
|
||||
@@ -2754,7 +2754,7 @@ impl Service {
|
||||
count: tenant_shard_id.shard_count,
|
||||
// We only import un-sharded or single-sharded tenants, so stripe
|
||||
// size can be made up arbitrarily here.
|
||||
stripe_size: ShardParameters::DEFAULT_STRIPE_SIZE,
|
||||
stripe_size: DEFAULT_STRIPE_SIZE,
|
||||
},
|
||||
placement_policy: Some(placement_policy),
|
||||
config: req.config.tenant_conf,
|
||||
@@ -7865,7 +7865,7 @@ impl Service {
|
||||
// old, persisted stripe size.
|
||||
let new_stripe_size = match candidate.id.shard_count.count() {
|
||||
0 => panic!("invalid shard count 0"),
|
||||
1 => Some(ShardParameters::DEFAULT_STRIPE_SIZE),
|
||||
1 => Some(DEFAULT_STRIPE_SIZE),
|
||||
2.. => None,
|
||||
};
|
||||
|
||||
|
||||
@@ -2000,7 +2000,7 @@ pub(crate) mod tests {
|
||||
use std::rc::Rc;
|
||||
|
||||
use pageserver_api::controller_api::NodeAvailability;
|
||||
use pageserver_api::shard::{ShardCount, ShardNumber};
|
||||
use pageserver_api::shard::{DEFAULT_STRIPE_SIZE, ShardCount, ShardNumber};
|
||||
use rand::SeedableRng;
|
||||
use rand::rngs::StdRng;
|
||||
use utils::id::TenantId;
|
||||
@@ -2012,6 +2012,7 @@ pub(crate) mod tests {
|
||||
let tenant_id = TenantId::generate();
|
||||
let shard_number = ShardNumber(0);
|
||||
let shard_count = ShardCount::new(1);
|
||||
let stripe_size = DEFAULT_STRIPE_SIZE;
|
||||
|
||||
let tenant_shard_id = TenantShardId {
|
||||
tenant_id,
|
||||
@@ -2020,12 +2021,7 @@ pub(crate) mod tests {
|
||||
};
|
||||
TenantShard::new(
|
||||
tenant_shard_id,
|
||||
ShardIdentity::new(
|
||||
shard_number,
|
||||
shard_count,
|
||||
pageserver_api::shard::ShardStripeSize(32768),
|
||||
)
|
||||
.unwrap(),
|
||||
ShardIdentity::new(shard_number, shard_count, stripe_size).unwrap(),
|
||||
policy,
|
||||
None,
|
||||
)
|
||||
@@ -2045,6 +2041,7 @@ pub(crate) mod tests {
|
||||
shard_count: ShardCount,
|
||||
preferred_az: Option<AvailabilityZone>,
|
||||
) -> Vec<TenantShard> {
|
||||
let stripe_size = DEFAULT_STRIPE_SIZE;
|
||||
(0..shard_count.count())
|
||||
.map(|i| {
|
||||
let shard_number = ShardNumber(i);
|
||||
@@ -2056,12 +2053,7 @@ pub(crate) mod tests {
|
||||
};
|
||||
TenantShard::new(
|
||||
tenant_shard_id,
|
||||
ShardIdentity::new(
|
||||
shard_number,
|
||||
shard_count,
|
||||
pageserver_api::shard::ShardStripeSize(32768),
|
||||
)
|
||||
.unwrap(),
|
||||
ShardIdentity::new(shard_number, shard_count, stripe_size).unwrap(),
|
||||
policy.clone(),
|
||||
preferred_az.clone(),
|
||||
)
|
||||
|
||||
Reference in New Issue
Block a user