Skip to content

Commit

Permalink
Merge pull request #4561 from neondatabase/releases/2023-06-23-hotfix
Browse files Browse the repository at this point in the history
Release 2023-06-23 (pageserver-only)
  • Loading branch information
skyzh authored Jun 23, 2023
2 parents fbd3ac1 + 6bc7561 commit cd17053
Show file tree
Hide file tree
Showing 2 changed files with 44 additions and 46 deletions.
86 changes: 43 additions & 43 deletions pageserver/src/bin/pageserver.rs
Original file line number Diff line number Diff line change
Expand Up @@ -495,50 +495,50 @@ fn start_pageserver(
Ok(())
},
);
}

if let Some(metric_collection_endpoint) = &conf.metric_collection_endpoint {
let background_jobs_barrier = background_jobs_barrier;
let metrics_ctx = RequestContext::todo_child(
TaskKind::MetricsCollection,
// This task itself shouldn't download anything.
// The actual size calculation does need downloads, and
// creates a child context with the right DownloadBehavior.
DownloadBehavior::Error,
);
task_mgr::spawn(
MGMT_REQUEST_RUNTIME.handle(),
TaskKind::MetricsCollection,
None,
None,
"consumption metrics collection",
true,
async move {
// first wait until background jobs are cleared to launch.
//
// this is because we only process active tenants and timelines, and the
// Timeline::get_current_logical_size will spawn the logical size calculation,
// which will not be rate-limited.
let cancel = task_mgr::shutdown_token();

tokio::select! {
_ = cancel.cancelled() => { return Ok(()); },
_ = background_jobs_barrier.wait() => {}
};

pageserver::consumption_metrics::collect_metrics(
metric_collection_endpoint,
conf.metric_collection_interval,
conf.cached_metric_collection_interval,
conf.synthetic_size_calculation_interval,
conf.id,
metrics_ctx,
)
.instrument(info_span!("metrics_collection"))
.await?;
Ok(())
},
);
}
if let Some(metric_collection_endpoint) = &conf.metric_collection_endpoint {
let background_jobs_barrier = background_jobs_barrier;
let metrics_ctx = RequestContext::todo_child(
TaskKind::MetricsCollection,
// This task itself shouldn't download anything.
// The actual size calculation does need downloads, and
// creates a child context with the right DownloadBehavior.
DownloadBehavior::Error,
);
task_mgr::spawn(
crate::BACKGROUND_RUNTIME.handle(),
TaskKind::MetricsCollection,
None,
None,
"consumption metrics collection",
true,
async move {
// first wait until background jobs are cleared to launch.
//
// this is because we only process active tenants and timelines, and the
// Timeline::get_current_logical_size will spawn the logical size calculation,
// which will not be rate-limited.
let cancel = task_mgr::shutdown_token();

tokio::select! {
_ = cancel.cancelled() => { return Ok(()); },
_ = background_jobs_barrier.wait() => {}
};

pageserver::consumption_metrics::collect_metrics(
metric_collection_endpoint,
conf.metric_collection_interval,
conf.cached_metric_collection_interval,
conf.synthetic_size_calculation_interval,
conf.id,
metrics_ctx,
)
.instrument(info_span!("metrics_collection"))
.await?;
Ok(())
},
);
}

// Spawn a task to listen for libpq connections. It will spawn further tasks
Expand Down
4 changes: 1 addition & 3 deletions pageserver/src/http/routes.rs
Original file line number Diff line number Diff line change
Expand Up @@ -1128,8 +1128,6 @@ async fn disk_usage_eviction_run(
freed_bytes: 0,
};

use crate::task_mgr::MGMT_REQUEST_RUNTIME;

let (tx, rx) = tokio::sync::oneshot::channel();

let state = get_state(&r);
Expand All @@ -1147,7 +1145,7 @@ async fn disk_usage_eviction_run(
let _g = cancel.drop_guard();

crate::task_mgr::spawn(
MGMT_REQUEST_RUNTIME.handle(),
crate::task_mgr::BACKGROUND_RUNTIME.handle(),
TaskKind::DiskUsageEviction,
None,
None,
Expand Down

1 comment on commit cd17053

@github-actions
Copy link

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

1016 tests run: 976 passed, 0 failed, 40 skipped (full report)


Flaky tests (1)

Postgres 15

  • test_remote_storage_upload_queue_retries[local_fs]: ✅ debug
The comment gets automatically updated with the latest test results
cd17053 at 2023-06-23T20:06:16.810Z :recycle:

Please sign in to comment.