Improve comments a little.

This commit is contained in:
Heikki Linnakangas
2022-08-23 12:17:20 +03:00
parent d110d2c2fd
commit 1a666a01d6
4 changed files with 12 additions and 9 deletions

View File

@@ -150,6 +150,9 @@ pub struct RemoteTimelineInfo {
pub awaits_download: bool,
}
///
/// This represents the output of the "timeline_detail" API call.
///
#[serde_as]
#[derive(Debug, Serialize, Deserialize, Clone)]
pub struct TimelineInfo {

View File

@@ -656,9 +656,9 @@ impl Repository {
/// Locate and load config
pub fn load_tenant_config(
conf: &'static PageServerConf,
tenantid: ZTenantId,
tenant_id: ZTenantId,
) -> anyhow::Result<TenantConfOpt> {
let target_config_path = TenantConf::path(conf, tenantid);
let target_config_path = TenantConf::path(conf, tenant_id);
info!("load tenantconf from {}", target_config_path.display());
@@ -693,11 +693,11 @@ impl Repository {
pub fn persist_tenant_config(
conf: &'static PageServerConf,
tenantid: ZTenantId,
tenant_id: ZTenantId,
tenant_conf: TenantConfOpt,
) -> anyhow::Result<()> {
let _enter = info_span!("saving tenantconf").entered();
let target_config_path = TenantConf::path(conf, tenantid);
let target_config_path = TenantConf::path(conf, tenant_id);
info!("save tenantconf to {}", target_config_path.display());
let mut conf_content = r#"# This file contains a specific per-tenant's config.
@@ -834,7 +834,7 @@ impl Repository {
// compaction (both require `layer_removal_cs` lock),
// but the GC iteration can run concurrently with branch creation.
//
// See comments in [`LayeredRepository::branch_timeline`] for more information
// See comments in [`Repository::branch_timeline`] for more information
// about why branch creation task can run concurrently with timeline's GC iteration.
for timeline in gc_timelines {
if thread_mgr::is_shutdown_requested() {

View File

@@ -354,8 +354,8 @@ pub struct Timeline {
upload_layers: AtomicBool,
/// Ensures layers aren't frozen by checkpointer between
/// [`LayeredTimeline::get_layer_for_write`] and layer reads.
/// Locked automatically by [`LayeredTimelineWriter`] and checkpointer.
/// [`Timeline::get_layer_for_write`] and layer reads.
/// Locked automatically by [`TimelineWriter`] and checkpointer.
/// Must always be acquired before the layer map/individual layer lock
/// to avoid deadlock.
write_lock: Mutex<()>,
@@ -365,7 +365,7 @@ pub struct Timeline {
/// Layer removal lock.
/// A lock to ensure that no layer of the timeline is removed concurrently by other threads.
/// This lock is acquired in [`LayeredTimeline::gc`], [`LayeredTimeline::compact`],
/// This lock is acquired in [`Timeline::gc`], [`Timeline::compact`],
/// and [`LayeredRepository::delete_timeline`].
layer_removal_cs: Mutex<()>,

View File

@@ -744,7 +744,7 @@ impl PageServerHandler {
let latest_gc_cutoff_lsn = timeline.get_latest_gc_cutoff_lsn();
let lsn = Self::wait_or_get_last_lsn(timeline, req.lsn, req.latest, &latest_gc_cutoff_lsn)?;
/*
// Add a 1s delay to some requests. The delayed causes the requests to
// Add a 1s delay to some requests. The delay helps the requests to
// hit the race condition from github issue #1047 more easily.
use rand::Rng;
if rand::thread_rng().gen::<u8>() < 5 {