Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

storage controller: use 'lazy' mode for location_config #6987

Merged
merged 3 commits into from
Mar 6, 2024
Merged
Show file tree
Hide file tree
Changes from 1 commit
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
7 changes: 6 additions & 1 deletion control_plane/attachment_service/src/reconciler.rs
Original file line number Diff line number Diff line change
Expand Up @@ -114,11 +114,16 @@ impl Reconciler {
.locations
.insert(node.id, ObservedStateLocation { conf: None });

// 'lazy' mode means that a tenant's activiation will be subject to a concurrency limit
// in the pageserver: this is the safer way to attach a tenant, as it avoids thundering
// herd I/O when attaching many tenants at the same time.
let lazy = true;
jcsp marked this conversation as resolved.
Show resolved Hide resolved

tracing::info!("location_config({}) calling: {:?}", node_id, config);
let client =
mgmt_api::Client::new(node.base_url(), self.service_config.jwt_token.as_deref());
client
.location_config(self.tenant_shard_id, config.clone(), flush_ms)
.location_config(self.tenant_shard_id, config.clone(), flush_ms, lazy)
.await?;
tracing::info!("location_config({}) complete: {:?}", node_id, config);

Expand Down
1 change: 1 addition & 0 deletions control_plane/attachment_service/src/service.rs
Original file line number Diff line number Diff line change
Expand Up @@ -445,6 +445,7 @@ impl Service {
tenant_conf: models::TenantConfig::default(),
},
None,
false,
)
.await
{
Expand Down
3 changes: 2 additions & 1 deletion control_plane/src/pageserver.rs
Original file line number Diff line number Diff line change
Expand Up @@ -537,10 +537,11 @@ impl PageServerNode {
tenant_shard_id: TenantShardId,
config: LocationConfig,
flush_ms: Option<Duration>,
lazy: bool,
) -> anyhow::Result<()> {
Ok(self
.http_client
.location_config(tenant_shard_id, config, flush_ms)
.location_config(tenant_shard_id, config, flush_ms, lazy)
.await?)
}

Expand Down
5 changes: 3 additions & 2 deletions pageserver/client/src/mgmt_api.rs
Original file line number Diff line number Diff line change
Expand Up @@ -251,17 +251,18 @@ impl Client {
tenant_shard_id: TenantShardId,
config: LocationConfig,
flush_ms: Option<std::time::Duration>,
lazy: bool,
) -> Result<()> {
let req_body = TenantLocationConfigRequest {
tenant_id: tenant_shard_id,
config,
};
let path = format!(
"{}/v1/tenant/{}/location_config",
"{}/v1/tenant/{}/location_config?lazy={lazy}",
self.mgmt_api_endpoint, tenant_shard_id
);
let path = if let Some(flush_ms) = flush_ms {
format!("{}?flush_ms={}", path, flush_ms.as_millis())
format!("{}&flush_ms={}", path, flush_ms.as_millis())
} else {
path
};
jcsp marked this conversation as resolved.
Show resolved Hide resolved
Expand Down