mirror of
https://github.com/neondatabase/neon.git
synced 2026-01-05 20:42:54 +00:00
utils: move ShardStripeSize into shard module (#12640)
## Problem `ShardStripeSize` will be used in the compute spec and internally in the communicator. It shouldn't require pulling in all of `pageserver_api`. ## Summary of changes Move `ShardStripeSize` into `utils::shard`, along with other basic shard types. Also remove the `Default` implementation, to discourage clients from falling back to a default (it's generally a footgun). The type is still re-exported from `pageserver_api::shard`, along with all the other shard types.
This commit is contained in:
@@ -981,7 +981,7 @@ mod tests {
|
||||
use pageserver_api::models::utilization::test_utilization;
|
||||
use pageserver_api::shard::ShardIdentity;
|
||||
use utils::id::TenantId;
|
||||
use utils::shard::{ShardCount, ShardNumber, TenantShardId};
|
||||
use utils::shard::{ShardCount, ShardNumber, ShardStripeSize, TenantShardId};
|
||||
|
||||
use super::*;
|
||||
use crate::tenant_shard::IntentState;
|
||||
@@ -1337,7 +1337,7 @@ mod tests {
|
||||
let shard_identity = ShardIdentity::new(
|
||||
tenant_shard_id.shard_number,
|
||||
tenant_shard_id.shard_count,
|
||||
pageserver_api::shard::ShardStripeSize(1),
|
||||
ShardStripeSize(1),
|
||||
)
|
||||
.unwrap();
|
||||
let mut shard = TenantShard::new(
|
||||
@@ -1411,7 +1411,7 @@ mod tests {
|
||||
let shard_identity = ShardIdentity::new(
|
||||
tenant_shard_id.shard_number,
|
||||
tenant_shard_id.shard_count,
|
||||
pageserver_api::shard::ShardStripeSize(1),
|
||||
ShardStripeSize(1),
|
||||
)
|
||||
.unwrap();
|
||||
let mut shard = TenantShard::new(
|
||||
@@ -1573,7 +1573,7 @@ mod tests {
|
||||
let shard_identity = ShardIdentity::new(
|
||||
tenant_shard_id.shard_number,
|
||||
tenant_shard_id.shard_count,
|
||||
pageserver_api::shard::ShardStripeSize(1),
|
||||
ShardStripeSize(1),
|
||||
)
|
||||
.unwrap();
|
||||
// 1 attached and 1 secondary.
|
||||
|
||||
Reference in New Issue
Block a user