repo
stringlengths
6
65
file_url
stringlengths
81
311
file_path
stringlengths
6
227
content
stringlengths
0
32.8k
language
stringclasses
1 value
license
stringclasses
7 values
commit_sha
stringlengths
40
40
retrieved_at
stringdate
2026-01-04 15:31:58
2026-01-04 20:25:31
truncated
bool
2 classes
neondatabase/neon
https://github.com/neondatabase/neon/blob/015b1c7cb3259a6fcd5039bc2bd46a462e163ae8/pageserver/src/config/ignored_fields.rs
pageserver/src/config/ignored_fields.rs
//! Check for fields in the on-disk config file that were ignored when //! deserializing [`pageserver_api::config::ConfigToml`]. //! //! This could have been part of the [`pageserver_api::config`] module, //! but the way we identify unused fields in this module //! is specific to the format (TOML) and the implementatio...
rust
Apache-2.0
015b1c7cb3259a6fcd5039bc2bd46a462e163ae8
2026-01-04T15:40:24.223849Z
false
neondatabase/neon
https://github.com/neondatabase/neon/blob/015b1c7cb3259a6fcd5039bc2bd46a462e163ae8/pageserver/src/walredo/process.rs
pageserver/src/walredo/process.rs
mod no_leak_child; /// The IPC protocol that pageserver and walredo process speak over their shared pipe. mod protocol; use std::collections::VecDeque; use std::process::{Command, Stdio}; #[cfg(feature = "testing")] use std::sync::atomic::AtomicUsize; use std::time::Duration; use anyhow::Context; use bytes::Bytes; us...
rust
Apache-2.0
015b1c7cb3259a6fcd5039bc2bd46a462e163ae8
2026-01-04T15:40:24.223849Z
false
neondatabase/neon
https://github.com/neondatabase/neon/blob/015b1c7cb3259a6fcd5039bc2bd46a462e163ae8/pageserver/src/walredo/apply_neon.rs
pageserver/src/walredo/apply_neon.rs
use anyhow::Context; use byteorder::{ByteOrder, LittleEndian}; use bytes::BytesMut; use pageserver_api::key::Key; use pageserver_api::reltag::SlruKind; use postgres_ffi::v14::nonrelfile_utils::{ mx_offset_to_flags_bitshift, mx_offset_to_flags_offset, mx_offset_to_member_offset, transaction_id_set_status, }; use...
rust
Apache-2.0
015b1c7cb3259a6fcd5039bc2bd46a462e163ae8
2026-01-04T15:40:24.223849Z
false
neondatabase/neon
https://github.com/neondatabase/neon/blob/015b1c7cb3259a6fcd5039bc2bd46a462e163ae8/pageserver/src/walredo/process/no_leak_child.rs
pageserver/src/walredo/process/no_leak_child.rs
use std::io; use std::ops::{Deref, DerefMut}; use std::process::{Child, Command}; use pageserver_api::shard::TenantShardId; use tracing::{error, info, instrument}; use crate::metrics::{WAL_REDO_PROCESS_COUNTERS, WalRedoKillCause}; /// Wrapper type around `std::process::Child` which guarantees that the child /// will...
rust
Apache-2.0
015b1c7cb3259a6fcd5039bc2bd46a462e163ae8
2026-01-04T15:40:24.223849Z
false
neondatabase/neon
https://github.com/neondatabase/neon/blob/015b1c7cb3259a6fcd5039bc2bd46a462e163ae8/pageserver/src/walredo/process/protocol.rs
pageserver/src/walredo/process/protocol.rs
use bytes::BufMut; use pageserver_api::reltag::RelTag; use serde::Serialize; use utils::bin_ser::BeSer; use utils::lsn::Lsn; /// /// `RelTag` + block number (`blknum`) gives us a unique id of the page in the cluster. /// /// In Postgres `BufferTag` structure is used for exactly the same purpose. /// [See more related ...
rust
Apache-2.0
015b1c7cb3259a6fcd5039bc2bd46a462e163ae8
2026-01-04T15:40:24.223849Z
false
neondatabase/neon
https://github.com/neondatabase/neon/blob/015b1c7cb3259a6fcd5039bc2bd46a462e163ae8/pageserver/src/http/mod.rs
pageserver/src/http/mod.rs
pub mod routes; pub use routes::make_router;
rust
Apache-2.0
015b1c7cb3259a6fcd5039bc2bd46a462e163ae8
2026-01-04T15:40:24.223849Z
false
neondatabase/neon
https://github.com/neondatabase/neon/blob/015b1c7cb3259a6fcd5039bc2bd46a462e163ae8/pageserver/src/http/routes.rs
pageserver/src/http/routes.rs
//! //! Management HTTP API //! use std::cmp::Reverse; use std::collections::BTreeMap; use std::collections::BinaryHeap; use std::collections::HashMap; use std::str::FromStr; use std::sync::Arc; use std::time::Duration; use anyhow::{Context, Result, anyhow}; use bytes::Bytes; use enumset::EnumSet; use futures::future:...
rust
Apache-2.0
015b1c7cb3259a6fcd5039bc2bd46a462e163ae8
2026-01-04T15:40:24.223849Z
true
neondatabase/neon
https://github.com/neondatabase/neon/blob/015b1c7cb3259a6fcd5039bc2bd46a462e163ae8/pageserver/benches/bench_ingest.rs
pageserver/benches/bench_ingest.rs
use std::env; use std::num::NonZeroUsize; use std::sync::Arc; use bytes::Bytes; use camino::Utf8PathBuf; use criterion::{Criterion, criterion_group, criterion_main}; use futures::stream::FuturesUnordered; use pageserver::config::PageServerConf; use pageserver::context::{DownloadBehavior, RequestContext}; use pageserve...
rust
Apache-2.0
015b1c7cb3259a6fcd5039bc2bd46a462e163ae8
2026-01-04T15:40:24.223849Z
false
neondatabase/neon
https://github.com/neondatabase/neon/blob/015b1c7cb3259a6fcd5039bc2bd46a462e163ae8/pageserver/benches/bench_metrics.rs
pageserver/benches/bench_metrics.rs
use criterion::{BenchmarkId, Criterion, criterion_group, criterion_main}; use utils::id::{TenantId, TimelineId}; // // Demonstrates that repeat label values lookup is a multicore scalability bottleneck // that is worth avoiding. // criterion_group!( label_values, label_values::bench_naive_usage, label_valu...
rust
Apache-2.0
015b1c7cb3259a6fcd5039bc2bd46a462e163ae8
2026-01-04T15:40:24.223849Z
false
neondatabase/neon
https://github.com/neondatabase/neon/blob/015b1c7cb3259a6fcd5039bc2bd46a462e163ae8/pageserver/benches/bench_walredo.rs
pageserver/benches/bench_walredo.rs
//! Quantify a single walredo manager's throughput under N concurrent callers. //! //! The benchmark implementation ([`bench_impl`]) is parametrized by //! - `redo_work` => an async closure that takes a `PostgresRedoManager` and performs one redo //! - `n_redos` => number of times the benchmark shell execute the `redo_...
rust
Apache-2.0
015b1c7cb3259a6fcd5039bc2bd46a462e163ae8
2026-01-04T15:40:24.223849Z
true
neondatabase/neon
https://github.com/neondatabase/neon/blob/015b1c7cb3259a6fcd5039bc2bd46a462e163ae8/pageserver/benches/upload_queue.rs
pageserver/benches/upload_queue.rs
//! Upload queue benchmarks. use std::str::FromStr as _; use std::sync::Arc; use std::sync::atomic::AtomicU32; use criterion::{Bencher, Criterion, criterion_group, criterion_main}; use pageserver::tenant::IndexPart; use pageserver::tenant::metadata::TimelineMetadata; use pageserver::tenant::remote_timeline_client::in...
rust
Apache-2.0
015b1c7cb3259a6fcd5039bc2bd46a462e163ae8
2026-01-04T15:40:24.223849Z
false
neondatabase/neon
https://github.com/neondatabase/neon/blob/015b1c7cb3259a6fcd5039bc2bd46a462e163ae8/pageserver/benches/bench_layer_map.rs
pageserver/benches/bench_layer_map.rs
use std::cmp::{max, min}; use std::fs::File; use std::io::{BufRead, BufReader}; use std::path::PathBuf; use std::str::FromStr; use std::time::Instant; use criterion::measurement::WallTime; use criterion::{BenchmarkGroup, Criterion, black_box, criterion_group, criterion_main}; use pageserver::tenant::layer_map::LayerMa...
rust
Apache-2.0
015b1c7cb3259a6fcd5039bc2bd46a462e163ae8
2026-01-04T15:40:24.223849Z
false
neondatabase/neon
https://github.com/neondatabase/neon/blob/015b1c7cb3259a6fcd5039bc2bd46a462e163ae8/pageserver/compaction/src/lib.rs
pageserver/compaction/src/lib.rs
// The main module implementing the compaction algorithm pub mod compact_tiered; pub(crate) mod identify_levels; // Traits that the caller of the compaction needs to implement pub mod interface; // Utility functions, useful for the implementation pub mod helpers; // A simulator with mock implementations of 'interfac...
rust
Apache-2.0
015b1c7cb3259a6fcd5039bc2bd46a462e163ae8
2026-01-04T15:40:24.223849Z
false
neondatabase/neon
https://github.com/neondatabase/neon/blob/015b1c7cb3259a6fcd5039bc2bd46a462e163ae8/pageserver/compaction/src/interface.rs
pageserver/compaction/src/interface.rs
//! This is what the compaction implementation needs to know about //! layers, keyspace etc. //! //! All the heavy lifting is done by the create_image and create_delta //! functions that the implementor provides. use std::ops::Range; use futures::Future; use pageserver_api::key::Key; use pageserver_api::keyspace::Shar...
rust
Apache-2.0
015b1c7cb3259a6fcd5039bc2bd46a462e163ae8
2026-01-04T15:40:24.223849Z
false
neondatabase/neon
https://github.com/neondatabase/neon/blob/015b1c7cb3259a6fcd5039bc2bd46a462e163ae8/pageserver/compaction/src/helpers.rs
pageserver/compaction/src/helpers.rs
//! This file contains generic utility functions over the interface types, //! which could be handy for any compaction implementation. use std::collections::{BinaryHeap, VecDeque}; use std::fmt::Display; use std::future::Future; use std::ops::{DerefMut, Range}; use std::pin::Pin; use std::task::{Poll, ready}; use futu...
rust
Apache-2.0
015b1c7cb3259a6fcd5039bc2bd46a462e163ae8
2026-01-04T15:40:24.223849Z
false
neondatabase/neon
https://github.com/neondatabase/neon/blob/015b1c7cb3259a6fcd5039bc2bd46a462e163ae8/pageserver/compaction/src/identify_levels.rs
pageserver/compaction/src/identify_levels.rs
//! An LSM tree consists of multiple levels, each exponentially larger than the //! previous level. And each level consists of multiple "tiers". With tiered //! compaction, a level is compacted when it has accumulated more than N tiers, //! forming one tier on the next level. //! //! In the pageserver, we don't explici...
rust
Apache-2.0
015b1c7cb3259a6fcd5039bc2bd46a462e163ae8
2026-01-04T15:40:24.223849Z
false
neondatabase/neon
https://github.com/neondatabase/neon/blob/015b1c7cb3259a6fcd5039bc2bd46a462e163ae8/pageserver/compaction/src/simulator.rs
pageserver/compaction/src/simulator.rs
mod draw; use std::fmt::Write; use std::ops::Range; use std::sync::{Arc, Mutex}; use draw::{LayerTraceEvent, LayerTraceFile, LayerTraceOp}; use futures::StreamExt; use pageserver_api::shard::ShardIdentity; use rand::Rng; use tracing::info; use utils::lsn::Lsn; use crate::helpers::{PAGE_SZ, merge_delta_keys, overlaps...
rust
Apache-2.0
015b1c7cb3259a6fcd5039bc2bd46a462e163ae8
2026-01-04T15:40:24.223849Z
false
neondatabase/neon
https://github.com/neondatabase/neon/blob/015b1c7cb3259a6fcd5039bc2bd46a462e163ae8/pageserver/compaction/src/compact_tiered.rs
pageserver/compaction/src/compact_tiered.rs
//! # Tiered compaction algorithm. //! //! Read all the input delta files, and write a new set of delta files that //! include all the input WAL records. See retile_deltas(). //! //! In a "normal" LSM tree, you get to remove any values that are overwritten by //! later values, but in our system, we keep all the history...
rust
Apache-2.0
015b1c7cb3259a6fcd5039bc2bd46a462e163ae8
2026-01-04T15:40:24.223849Z
false
neondatabase/neon
https://github.com/neondatabase/neon/blob/015b1c7cb3259a6fcd5039bc2bd46a462e163ae8/pageserver/compaction/src/simulator/draw.rs
pageserver/compaction/src/simulator/draw.rs
use std::cmp::Ordering; use std::collections::{BTreeMap, BTreeSet, HashSet}; use std::fmt::Write; use std::ops::Range; use anyhow::Result; use svg_fmt::{BeginSvg, EndSvg, Fill, Stroke, Style, rgb}; use utils::lsn::Lsn; use super::Key; // Map values to their compressed coordinate - the index the value // would have i...
rust
Apache-2.0
015b1c7cb3259a6fcd5039bc2bd46a462e163ae8
2026-01-04T15:40:24.223849Z
false
neondatabase/neon
https://github.com/neondatabase/neon/blob/015b1c7cb3259a6fcd5039bc2bd46a462e163ae8/pageserver/compaction/src/bin/compaction-simulator.rs
pageserver/compaction/src/bin/compaction-simulator.rs
use std::io::Write; use std::path::{Path, PathBuf}; use std::sync::OnceLock; use clap::{Parser, Subcommand}; use pageserver_compaction::helpers::PAGE_SZ; use pageserver_compaction::simulator::MockTimeline; use rand::Rng; use utils::project_git_version; project_git_version!(GIT_VERSION); #[derive(Parser)] #[command( ...
rust
Apache-2.0
015b1c7cb3259a6fcd5039bc2bd46a462e163ae8
2026-01-04T15:40:24.223849Z
false
neondatabase/neon
https://github.com/neondatabase/neon/blob/015b1c7cb3259a6fcd5039bc2bd46a462e163ae8/pageserver/compaction/tests/tests.rs
pageserver/compaction/tests/tests.rs
use once_cell::sync::OnceCell; use pageserver_compaction::interface::CompactionLayer; use pageserver_compaction::simulator::MockTimeline; use utils::logging; static LOG_HANDLE: OnceCell<()> = OnceCell::new(); pub(crate) fn setup_logging() { LOG_HANDLE.get_or_init(|| { logging::init( logging::L...
rust
Apache-2.0
015b1c7cb3259a6fcd5039bc2bd46a462e163ae8
2026-01-04T15:40:24.223849Z
false
neondatabase/neon
https://github.com/neondatabase/neon/blob/015b1c7cb3259a6fcd5039bc2bd46a462e163ae8/pageserver/ctl/src/index_part.rs
pageserver/ctl/src/index_part.rs
use std::str::FromStr; use anyhow::{Context, Ok}; use camino::Utf8PathBuf; use pageserver::tenant::{ IndexPart, layer_map::{LayerMap, SearchResult}, remote_timeline_client::{index::LayerFileMetadata, remote_layer_path}, storage_layer::{LayerName, LayerVisibilityHint, PersistentLayerDesc, ReadableLayerW...
rust
Apache-2.0
015b1c7cb3259a6fcd5039bc2bd46a462e163ae8
2026-01-04T15:40:24.223849Z
false
neondatabase/neon
https://github.com/neondatabase/neon/blob/015b1c7cb3259a6fcd5039bc2bd46a462e163ae8/pageserver/ctl/src/layers.rs
pageserver/ctl/src/layers.rs
use std::fs::{self, File}; use std::path::{Path, PathBuf}; use anyhow::Result; use camino::{Utf8Path, Utf8PathBuf}; use clap::Subcommand; use pageserver::context::{DownloadBehavior, RequestContext}; use pageserver::task_mgr::TaskKind; use pageserver::tenant::storage_layer::{DeltaLayer, ImageLayer, delta_layer, image_l...
rust
Apache-2.0
015b1c7cb3259a6fcd5039bc2bd46a462e163ae8
2026-01-04T15:40:24.223849Z
false
neondatabase/neon
https://github.com/neondatabase/neon/blob/015b1c7cb3259a6fcd5039bc2bd46a462e163ae8/pageserver/ctl/src/key.rs
pageserver/ctl/src/key.rs
use std::str::FromStr; use anyhow::Context; use clap::Parser; use pageserver_api::key::Key; use pageserver_api::reltag::{BlockNumber, RelTag, SlruKind}; use pageserver_api::shard::{DEFAULT_STRIPE_SIZE, ShardCount, ShardStripeSize}; #[derive(Parser)] pub(super) struct DescribeKeyCommand { /// Key material in one o...
rust
Apache-2.0
015b1c7cb3259a6fcd5039bc2bd46a462e163ae8
2026-01-04T15:40:24.223849Z
false
neondatabase/neon
https://github.com/neondatabase/neon/blob/015b1c7cb3259a6fcd5039bc2bd46a462e163ae8/pageserver/ctl/src/layer_map_analyzer.rs
pageserver/ctl/src/layer_map_analyzer.rs
//! Tool for extracting content-dependent metadata about layers. Useful for scanning real project layer files and evaluating the effectiveness of different heuristics on them. //! //! Currently it only analyzes holes, which are regions within the layer range that the layer contains no updates for. In the future it migh...
rust
Apache-2.0
015b1c7cb3259a6fcd5039bc2bd46a462e163ae8
2026-01-04T15:40:24.223849Z
false
neondatabase/neon
https://github.com/neondatabase/neon/blob/015b1c7cb3259a6fcd5039bc2bd46a462e163ae8/pageserver/ctl/src/download_remote_object.rs
pageserver/ctl/src/download_remote_object.rs
use camino::Utf8PathBuf; use clap::Parser; use tokio_util::sync::CancellationToken; /// Download a specific object from remote storage to a local file. /// /// The remote storage configuration is supplied via the `REMOTE_STORAGE_CONFIG` environment /// variable, in the same TOML format that the pageserver itself under...
rust
Apache-2.0
015b1c7cb3259a6fcd5039bc2bd46a462e163ae8
2026-01-04T15:40:24.223849Z
false
neondatabase/neon
https://github.com/neondatabase/neon/blob/015b1c7cb3259a6fcd5039bc2bd46a462e163ae8/pageserver/ctl/src/draw_timeline_dir.rs
pageserver/ctl/src/draw_timeline_dir.rs
//! A tool for visualizing the arrangement of layerfiles within a timeline. //! //! It reads filenames from stdin and prints a svg on stdout. The image is a plot in //! page-lsn space, where every delta layer is a rectangle and every image layer is a //! thick line. Legend: //! - The x axis (left to right) represents p...
rust
Apache-2.0
015b1c7cb3259a6fcd5039bc2bd46a462e163ae8
2026-01-04T15:40:24.223849Z
false
neondatabase/neon
https://github.com/neondatabase/neon/blob/015b1c7cb3259a6fcd5039bc2bd46a462e163ae8/pageserver/ctl/src/main.rs
pageserver/ctl/src/main.rs
//! A helper tool to manage pageserver binary files. //! Accepts a file as an argument, attempts to parse it with all ways possible //! and prints its interpreted context. //! //! Separate, `metadata` subcommand allows to print and update pageserver's metadata file. mod download_remote_object; mod draw_timeline_dir; m...
rust
Apache-2.0
015b1c7cb3259a6fcd5039bc2bd46a462e163ae8
2026-01-04T15:40:24.223849Z
false
neondatabase/neon
https://github.com/neondatabase/neon/blob/015b1c7cb3259a6fcd5039bc2bd46a462e163ae8/pageserver/ctl/src/page_trace.rs
pageserver/ctl/src/page_trace.rs
use std::collections::HashMap; use std::io::BufReader; use camino::Utf8PathBuf; use clap::Parser; use itertools::Itertools as _; use pageserver_api::key::{CompactKey, Key}; use pageserver_api::models::PageTraceEvent; use pageserver_api::reltag::RelTag; /// Parses a page trace (as emitted by the `page_trace` timeline ...
rust
Apache-2.0
015b1c7cb3259a6fcd5039bc2bd46a462e163ae8
2026-01-04T15:40:24.223849Z
false
neondatabase/neon
https://github.com/neondatabase/neon/blob/015b1c7cb3259a6fcd5039bc2bd46a462e163ae8/pageserver/client_grpc/src/lib.rs
pageserver/client_grpc/src/lib.rs
mod client; mod pool; mod retry; pub use client::{PageserverClient, ShardSpec};
rust
Apache-2.0
015b1c7cb3259a6fcd5039bc2bd46a462e163ae8
2026-01-04T15:40:24.223849Z
false
neondatabase/neon
https://github.com/neondatabase/neon/blob/015b1c7cb3259a6fcd5039bc2bd46a462e163ae8/pageserver/client_grpc/src/client.rs
pageserver/client_grpc/src/client.rs
use std::collections::HashMap; use std::num::NonZero; use std::pin::pin; use std::sync::Arc; use std::time::{Duration, Instant}; use anyhow::anyhow; use arc_swap::ArcSwap; use futures::stream::FuturesUnordered; use futures::{FutureExt as _, StreamExt as _}; use tonic::codec::CompressionEncoding; use tracing::{debug, i...
rust
Apache-2.0
015b1c7cb3259a6fcd5039bc2bd46a462e163ae8
2026-01-04T15:40:24.223849Z
false
neondatabase/neon
https://github.com/neondatabase/neon/blob/015b1c7cb3259a6fcd5039bc2bd46a462e163ae8/pageserver/client_grpc/src/retry.rs
pageserver/client_grpc/src/retry.rs
use std::time::Duration; use futures::future::pending; use tokio::time::Instant; use tracing::{error, info, warn}; use utils::backoff::exponential_backoff_duration; /// A retry handler for Pageserver gRPC requests. /// /// This is used instead of backoff::retry for better control and observability. pub struct Retry ...
rust
Apache-2.0
015b1c7cb3259a6fcd5039bc2bd46a462e163ae8
2026-01-04T15:40:24.223849Z
false
neondatabase/neon
https://github.com/neondatabase/neon/blob/015b1c7cb3259a6fcd5039bc2bd46a462e163ae8/pageserver/client_grpc/src/pool.rs
pageserver/client_grpc/src/pool.rs
//! This module provides various Pageserver gRPC client resource pools. //! //! These pools are designed to reuse gRPC resources (connections, clients, and streams) across //! multiple concurrent callers (i.e. Postgres backends). This avoids the resource cost and latency //! of creating dedicated TCP connections and se...
rust
Apache-2.0
015b1c7cb3259a6fcd5039bc2bd46a462e163ae8
2026-01-04T15:40:24.223849Z
false
neondatabase/neon
https://github.com/neondatabase/neon/blob/015b1c7cb3259a6fcd5039bc2bd46a462e163ae8/pageserver/client/src/mgmt_api.rs
pageserver/client/src/mgmt_api.rs
use std::collections::{BTreeMap, HashMap}; use std::error::Error as _; use std::time::Duration; use bytes::Bytes; use detach_ancestor::AncestorDetached; use http_utils::error::HttpErrorBody; use pageserver_api::models::*; use pageserver_api::shard::TenantShardId; use postgres_versioninfo::PgMajorVersion; pub use reqwe...
rust
Apache-2.0
015b1c7cb3259a6fcd5039bc2bd46a462e163ae8
2026-01-04T15:40:24.223849Z
false
neondatabase/neon
https://github.com/neondatabase/neon/blob/015b1c7cb3259a6fcd5039bc2bd46a462e163ae8/pageserver/client/src/lib.rs
pageserver/client/src/lib.rs
pub mod mgmt_api; pub mod page_service; /// For timeline_block_unblock_gc, distinguish the two different operations. This could be a bool. // If file structure is per-kind not per-feature then where to put this? #[derive(Clone, Copy)] pub enum BlockUnblock { Block, Unblock, } impl std::fmt::Display for BlockU...
rust
Apache-2.0
015b1c7cb3259a6fcd5039bc2bd46a462e163ae8
2026-01-04T15:40:24.223849Z
false
neondatabase/neon
https://github.com/neondatabase/neon/blob/015b1c7cb3259a6fcd5039bc2bd46a462e163ae8/pageserver/client/src/page_service.rs
pageserver/client/src/page_service.rs
use std::sync::{Arc, Mutex}; use futures::stream::{SplitSink, SplitStream}; use futures::{SinkExt, StreamExt}; use pageserver_api::pagestream_api::{ PagestreamBeMessage, PagestreamFeMessage, PagestreamGetPageRequest, PagestreamGetPageResponse, }; use pageserver_api::reltag::RelTag; use tokio::task::JoinHandle; use...
rust
Apache-2.0
015b1c7cb3259a6fcd5039bc2bd46a462e163ae8
2026-01-04T15:40:24.223849Z
false
neondatabase/neon
https://github.com/neondatabase/neon/blob/015b1c7cb3259a6fcd5039bc2bd46a462e163ae8/pageserver/client/src/mgmt_api/util.rs
pageserver/client/src/mgmt_api/util.rs
//! Helpers to do common higher-level tasks with the [`Client`]. use std::sync::Arc; use pageserver_api::shard::TenantShardId; use tokio::task::JoinSet; use utils::id::{TenantId, TenantTimelineId}; use super::Client; /// Retrieve a list of all of the pageserver's timelines. /// /// Fails if there are sharded tenant...
rust
Apache-2.0
015b1c7cb3259a6fcd5039bc2bd46a462e163ae8
2026-01-04T15:40:24.223849Z
false
neondatabase/neon
https://github.com/neondatabase/neon/blob/015b1c7cb3259a6fcd5039bc2bd46a462e163ae8/pageserver/pagebench/src/main.rs
pageserver/pagebench/src/main.rs
use std::fs::File; use clap::Parser; use tracing::info; use utils::logging; /// Re-usable pieces of code that aren't CLI-specific. mod util { pub(crate) mod request_stats; #[macro_use] pub(crate) mod tokio_thread_local_stats; /// Re-usable pieces of CLI-specific code. pub(crate) mod cli { ...
rust
Apache-2.0
015b1c7cb3259a6fcd5039bc2bd46a462e163ae8
2026-01-04T15:40:24.223849Z
false
neondatabase/neon
https://github.com/neondatabase/neon/blob/015b1c7cb3259a6fcd5039bc2bd46a462e163ae8/pageserver/pagebench/src/util/tokio_thread_local_stats.rs
pageserver/pagebench/src/util/tokio_thread_local_stats.rs
pub(crate) type ThreadLocalStats<T> = Arc<Mutex<T>>; pub(crate) type AllThreadLocalStats<T> = Arc<Mutex<Vec<ThreadLocalStats<T>>>>; macro_rules! declare { ($THREAD_LOCAL_NAME:ident: $T:ty) => { thread_local! { pub static $THREAD_LOCAL_NAME: std::cell::RefCell<crate::util::tokio_thread_local_sta...
rust
Apache-2.0
015b1c7cb3259a6fcd5039bc2bd46a462e163ae8
2026-01-04T15:40:24.223849Z
false
neondatabase/neon
https://github.com/neondatabase/neon/blob/015b1c7cb3259a6fcd5039bc2bd46a462e163ae8/pageserver/pagebench/src/util/request_stats.rs
pageserver/pagebench/src/util/request_stats.rs
use std::time::Duration; use anyhow::Context; pub(crate) struct Stats { latency_histo: hdrhistogram::Histogram<u64>, } impl Stats { pub(crate) fn new() -> Self { Self { // Initialize with fixed bounds so that we panic at runtime instead of resizing the histogram, // which woul...
rust
Apache-2.0
015b1c7cb3259a6fcd5039bc2bd46a462e163ae8
2026-01-04T15:40:24.223849Z
false
neondatabase/neon
https://github.com/neondatabase/neon/blob/015b1c7cb3259a6fcd5039bc2bd46a462e163ae8/pageserver/pagebench/src/util/cli/targets.rs
pageserver/pagebench/src/util/cli/targets.rs
use std::sync::Arc; use pageserver_client::mgmt_api; use tracing::info; use utils::id::TenantTimelineId; pub(crate) struct Spec { pub(crate) limit_to_first_n_targets: Option<usize>, pub(crate) targets: Option<Vec<TenantTimelineId>>, } pub(crate) async fn discover( api_client: &Arc<mgmt_api::Client>, ...
rust
Apache-2.0
015b1c7cb3259a6fcd5039bc2bd46a462e163ae8
2026-01-04T15:40:24.223849Z
false
neondatabase/neon
https://github.com/neondatabase/neon/blob/015b1c7cb3259a6fcd5039bc2bd46a462e163ae8/pageserver/pagebench/src/cmd/basebackup.rs
pageserver/pagebench/src/cmd/basebackup.rs
use std::collections::HashMap; use std::num::NonZeroUsize; use std::ops::Range; use std::pin::Pin; use std::sync::atomic::{AtomicU64, Ordering}; use std::sync::{Arc, Mutex}; use std::time::Instant; use anyhow::anyhow; use futures::TryStreamExt as _; use pageserver_api::shard::TenantShardId; use pageserver_client::mgmt...
rust
Apache-2.0
015b1c7cb3259a6fcd5039bc2bd46a462e163ae8
2026-01-04T15:40:24.223849Z
false
neondatabase/neon
https://github.com/neondatabase/neon/blob/015b1c7cb3259a6fcd5039bc2bd46a462e163ae8/pageserver/pagebench/src/cmd/ondemand_download_churn.rs
pageserver/pagebench/src/cmd/ondemand_download_churn.rs
use std::f64; use std::num::NonZeroUsize; use std::sync::Arc; use std::sync::atomic::{AtomicU64, Ordering}; use std::time::{Duration, Instant}; use pageserver_api::models::HistoricLayerInfo; use pageserver_api::shard::TenantShardId; use pageserver_client::mgmt_api; use rand::seq::IndexedMutRandom; use tokio::sync::{Ow...
rust
Apache-2.0
015b1c7cb3259a6fcd5039bc2bd46a462e163ae8
2026-01-04T15:40:24.223849Z
false
neondatabase/neon
https://github.com/neondatabase/neon/blob/015b1c7cb3259a6fcd5039bc2bd46a462e163ae8/pageserver/pagebench/src/cmd/idle_streams.rs
pageserver/pagebench/src/cmd/idle_streams.rs
use std::sync::Arc; use anyhow::anyhow; use futures::StreamExt; use tonic::transport::Endpoint; use tracing::info; use pageserver_page_api::{GetPageClass, GetPageRequest, GetPageStatusCode, ReadLsn, RelTag}; use utils::id::TenantTimelineId; use utils::lsn::Lsn; use utils::shard::ShardIndex; /// Starts a large number...
rust
Apache-2.0
015b1c7cb3259a6fcd5039bc2bd46a462e163ae8
2026-01-04T15:40:24.223849Z
false
neondatabase/neon
https://github.com/neondatabase/neon/blob/015b1c7cb3259a6fcd5039bc2bd46a462e163ae8/pageserver/pagebench/src/cmd/aux_files.rs
pageserver/pagebench/src/cmd/aux_files.rs
use std::collections::HashMap; use std::sync::Arc; use std::time::Instant; use pageserver_api::models::{TenantConfig, TenantConfigRequest}; use pageserver_api::shard::TenantShardId; use utils::id::TenantTimelineId; use utils::lsn::Lsn; /// Ingest aux files into the pageserver. #[derive(clap::Parser)] pub(crate) struc...
rust
Apache-2.0
015b1c7cb3259a6fcd5039bc2bd46a462e163ae8
2026-01-04T15:40:24.223849Z
false
neondatabase/neon
https://github.com/neondatabase/neon/blob/015b1c7cb3259a6fcd5039bc2bd46a462e163ae8/pageserver/pagebench/src/cmd/trigger_initial_size_calculation.rs
pageserver/pagebench/src/cmd/trigger_initial_size_calculation.rs
use std::sync::Arc; use humantime::Duration; use pageserver_api::shard::TenantShardId; use pageserver_client::mgmt_api::ForceAwaitLogicalSize; use tokio::task::JoinSet; use utils::id::TenantTimelineId; #[derive(clap::Parser)] pub(crate) struct Args { #[clap(long, default_value = "http://localhost:9898")] mgmt...
rust
Apache-2.0
015b1c7cb3259a6fcd5039bc2bd46a462e163ae8
2026-01-04T15:40:24.223849Z
false
neondatabase/neon
https://github.com/neondatabase/neon/blob/015b1c7cb3259a6fcd5039bc2bd46a462e163ae8/pageserver/pagebench/src/cmd/getpage_latest_lsn.rs
pageserver/pagebench/src/cmd/getpage_latest_lsn.rs
use std::collections::{HashMap, HashSet, VecDeque}; use std::future::Future; use std::num::NonZeroUsize; use std::pin::Pin; use std::sync::atomic::{AtomicU64, Ordering}; use std::sync::{Arc, Mutex}; use std::time::{Duration, Instant}; use anyhow::Context; use async_trait::async_trait; use bytes::Bytes; use camino::Utf...
rust
Apache-2.0
015b1c7cb3259a6fcd5039bc2bd46a462e163ae8
2026-01-04T15:40:24.223849Z
false
neondatabase/neon
https://github.com/neondatabase/neon/blob/015b1c7cb3259a6fcd5039bc2bd46a462e163ae8/control_plane/src/branch_mappings.rs
control_plane/src/branch_mappings.rs
//! Branch mappings for convenience use std::collections::HashMap; use std::fs; use std::path::Path; use anyhow::{bail, Context}; use serde::{Deserialize, Serialize}; use utils::id::{TenantId, TenantTimelineId, TimelineId}; /// Keep human-readable aliases in memory (and persist them to config XXX), to hide tenant/t...
rust
Apache-2.0
015b1c7cb3259a6fcd5039bc2bd46a462e163ae8
2026-01-04T15:40:24.223849Z
false
neondatabase/neon
https://github.com/neondatabase/neon/blob/015b1c7cb3259a6fcd5039bc2bd46a462e163ae8/control_plane/src/postgresql_conf.rs
control_plane/src/postgresql_conf.rs
use std::collections::HashMap; use std::fmt; /// /// Module for parsing postgresql.conf file. /// /// NOTE: This doesn't implement the full, correct postgresql.conf syntax. Just /// enough to extract a few settings we need in Neon, assuming you don't do /// funny stuff like include-directives or funny escaping. use on...
rust
Apache-2.0
015b1c7cb3259a6fcd5039bc2bd46a462e163ae8
2026-01-04T15:40:24.223849Z
false
neondatabase/neon
https://github.com/neondatabase/neon/blob/015b1c7cb3259a6fcd5039bc2bd46a462e163ae8/control_plane/src/lib.rs
control_plane/src/lib.rs
//! Local control plane. //! //! Can start, configure and stop postgres instances running as a local processes. //! //! Intended to be used in integration tests and in CLI tools for //! local installations. #![deny(clippy::undocumented_unsafe_blocks)] mod background_process; pub mod broker; pub mod endpoint; pub mod e...
rust
Apache-2.0
015b1c7cb3259a6fcd5039bc2bd46a462e163ae8
2026-01-04T15:40:24.223849Z
false
neondatabase/neon
https://github.com/neondatabase/neon/blob/015b1c7cb3259a6fcd5039bc2bd46a462e163ae8/control_plane/src/pageserver.rs
control_plane/src/pageserver.rs
//! Code to manage pageservers //! //! In the local test environment, the data for each pageserver is stored in //! //! ```text //! .neon/pageserver_<pageserver_id> //! ``` //! use std::collections::HashMap; use std::io; use std::io::Write; use std::num::NonZeroU64; use std::path::PathBuf; use std::str::FromStr; use ...
rust
Apache-2.0
015b1c7cb3259a6fcd5039bc2bd46a462e163ae8
2026-01-04T15:40:24.223849Z
false
neondatabase/neon
https://github.com/neondatabase/neon/blob/015b1c7cb3259a6fcd5039bc2bd46a462e163ae8/control_plane/src/endpoint_storage.rs
control_plane/src/endpoint_storage.rs
use crate::background_process::{self, start_process, stop_process}; use crate::local_env::LocalEnv; use anyhow::{Context, Result}; use camino::Utf8PathBuf; use std::io::Write; use std::net::SocketAddr; use std::time::Duration; /// Directory within .neon which will be used by default for LocalFs remote storage. pub con...
rust
Apache-2.0
015b1c7cb3259a6fcd5039bc2bd46a462e163ae8
2026-01-04T15:40:24.223849Z
false
neondatabase/neon
https://github.com/neondatabase/neon/blob/015b1c7cb3259a6fcd5039bc2bd46a462e163ae8/control_plane/src/safekeeper.rs
control_plane/src/safekeeper.rs
//! Code to manage safekeepers //! //! In the local test environment, the data for each safekeeper is stored in //! //! ```text //! .neon/safekeepers/<safekeeper id> //! ``` use std::error::Error as _; use std::io::Write; use std::path::PathBuf; use std::time::Duration; use std::{io, result}; use anyhow::Context; us...
rust
Apache-2.0
015b1c7cb3259a6fcd5039bc2bd46a462e163ae8
2026-01-04T15:40:24.223849Z
false
neondatabase/neon
https://github.com/neondatabase/neon/blob/015b1c7cb3259a6fcd5039bc2bd46a462e163ae8/control_plane/src/local_env.rs
control_plane/src/local_env.rs
//! This module is responsible for locating and loading paths in a local setup. //! //! Now it also provides init method which acts like a stub for proper installation //! script which will use local paths. use std::collections::HashMap; use std::net::SocketAddr; use std::path::{Path, PathBuf}; use std::process::{Comm...
rust
Apache-2.0
015b1c7cb3259a6fcd5039bc2bd46a462e163ae8
2026-01-04T15:40:24.223849Z
true
neondatabase/neon
https://github.com/neondatabase/neon/blob/015b1c7cb3259a6fcd5039bc2bd46a462e163ae8/control_plane/src/background_process.rs
control_plane/src/background_process.rs
//! Spawns and kills background processes that are needed by Neon CLI. //! Applies common set-up such as log and pid files (if needed) to every process. //! //! Neon CLI does not run in background, so it needs to store the information about //! spawned processes, which it does in this module. //! We do that by storing ...
rust
Apache-2.0
015b1c7cb3259a6fcd5039bc2bd46a462e163ae8
2026-01-04T15:40:24.223849Z
false
neondatabase/neon
https://github.com/neondatabase/neon/blob/015b1c7cb3259a6fcd5039bc2bd46a462e163ae8/control_plane/src/storage_controller.rs
control_plane/src/storage_controller.rs
use std::ffi::OsStr; use std::fs; use std::path::PathBuf; use std::process::ExitStatus; use std::str::FromStr; use std::sync::OnceLock; use std::time::{Duration, Instant}; use crate::background_process; use crate::local_env::{LocalEnv, NeonStorageControllerConf}; use camino::{Utf8Path, Utf8PathBuf}; use hyper0::Uri; u...
rust
Apache-2.0
015b1c7cb3259a6fcd5039bc2bd46a462e163ae8
2026-01-04T15:40:24.223849Z
true
neondatabase/neon
https://github.com/neondatabase/neon/blob/015b1c7cb3259a6fcd5039bc2bd46a462e163ae8/control_plane/src/broker.rs
control_plane/src/broker.rs
//! Code to manage the storage broker //! //! In the local test environment, the storage broker stores its data directly in //! //! ```text //! .neon/storage_broker //! ``` use std::time::Duration; use anyhow::Context; use camino::Utf8PathBuf; use crate::{background_process, local_env::LocalEnv}; pub struct Storag...
rust
Apache-2.0
015b1c7cb3259a6fcd5039bc2bd46a462e163ae8
2026-01-04T15:40:24.223849Z
false
neondatabase/neon
https://github.com/neondatabase/neon/blob/015b1c7cb3259a6fcd5039bc2bd46a462e163ae8/control_plane/src/endpoint.rs
control_plane/src/endpoint.rs
//! Code to manage compute endpoints //! //! In the local test environment, the data for each endpoint is stored in //! //! ```text //! .neon/endpoints/<endpoint id> //! ``` //! //! Some basic information about the endpoint, like the tenant and timeline IDs, //! are stored in the `endpoint.json` file. The `endpoint.j...
rust
Apache-2.0
015b1c7cb3259a6fcd5039bc2bd46a462e163ae8
2026-01-04T15:40:24.223849Z
true
neondatabase/neon
https://github.com/neondatabase/neon/blob/015b1c7cb3259a6fcd5039bc2bd46a462e163ae8/control_plane/src/bin/neon_local.rs
control_plane/src/bin/neon_local.rs
//! //! `neon_local` is an executable that can be used to create a local //! Neon environment, for testing purposes. The local environment is //! quite different from the cloud environment with Kubernetes, but it //! easier to work with locally. The python tests in `test_runner` //! rely on `neon_local` to set up the e...
rust
Apache-2.0
015b1c7cb3259a6fcd5039bc2bd46a462e163ae8
2026-01-04T15:40:24.223849Z
true
neondatabase/neon
https://github.com/neondatabase/neon/blob/015b1c7cb3259a6fcd5039bc2bd46a462e163ae8/control_plane/storcon_cli/src/main.rs
control_plane/storcon_cli/src/main.rs
use std::collections::{HashMap, HashSet}; use std::path::PathBuf; use std::str::FromStr; use std::time::Duration; use clap::{Parser, Subcommand}; use futures::StreamExt; use pageserver_api::controller_api::{ AvailabilityZone, MigrationConfig, NodeAvailabilityWrapper, NodeConfigureRequest, NodeDescribeResponse,...
rust
Apache-2.0
015b1c7cb3259a6fcd5039bc2bd46a462e163ae8
2026-01-04T15:40:24.223849Z
true
neondatabase/neon
https://github.com/neondatabase/neon/blob/015b1c7cb3259a6fcd5039bc2bd46a462e163ae8/endpoint_storage/src/app.rs
endpoint_storage/src/app.rs
use anyhow::anyhow; use axum::body::{Body, Bytes}; use axum::response::{IntoResponse, Response}; use axum::{Router, http::StatusCode}; use endpoint_storage::{PrefixS3Path, S3Path, Storage, bad_request, internal_error, not_found, ok}; use remote_storage::TimeoutOrCancel; use remote_storage::{DownloadError, DownloadOpts,...
rust
Apache-2.0
015b1c7cb3259a6fcd5039bc2bd46a462e163ae8
2026-01-04T15:40:24.223849Z
false
neondatabase/neon
https://github.com/neondatabase/neon/blob/015b1c7cb3259a6fcd5039bc2bd46a462e163ae8/endpoint_storage/src/lib.rs
endpoint_storage/src/lib.rs
pub mod claims; use crate::claims::{DeletePrefixClaims, EndpointStorageClaims}; use anyhow::Result; use axum::extract::{FromRequestParts, Path}; use axum::response::{IntoResponse, Response}; use axum::{RequestPartsExt, http::StatusCode, http::request::Parts}; use axum_extra::TypedHeader; use axum_extra::headers::{Autho...
rust
Apache-2.0
015b1c7cb3259a6fcd5039bc2bd46a462e163ae8
2026-01-04T15:40:24.223849Z
false
neondatabase/neon
https://github.com/neondatabase/neon/blob/015b1c7cb3259a6fcd5039bc2bd46a462e163ae8/endpoint_storage/src/claims.rs
endpoint_storage/src/claims.rs
use serde::{Deserialize, Serialize}; use std::fmt::Display; use utils::id::{EndpointId, TenantId, TimelineId}; /// Claims to add, remove, or retrieve endpoint data. Used by compute_ctl #[derive(Deserialize, Serialize, PartialEq)] pub struct EndpointStorageClaims { pub tenant_id: TenantId, pub timeline_id: Time...
rust
Apache-2.0
015b1c7cb3259a6fcd5039bc2bd46a462e163ae8
2026-01-04T15:40:24.223849Z
false
neondatabase/neon
https://github.com/neondatabase/neon/blob/015b1c7cb3259a6fcd5039bc2bd46a462e163ae8/endpoint_storage/src/main.rs
endpoint_storage/src/main.rs
//! `endpoint_storage` is a service which provides API for uploading and downloading //! files. It is used by compute and control plane for accessing LFC prewarm data. //! This service is deployed either as a separate component or as part of compute image //! for large computes. mod app; use anyhow::Context; use clap::...
rust
Apache-2.0
015b1c7cb3259a6fcd5039bc2bd46a462e163ae8
2026-01-04T15:40:24.223849Z
false
neondatabase/neon
https://github.com/neondatabase/neon/blob/015b1c7cb3259a6fcd5039bc2bd46a462e163ae8/storage_scrubber/src/pageserver_physical_gc.rs
storage_scrubber/src/pageserver_physical_gc.rs
use std::collections::{BTreeMap, BTreeSet, HashMap}; use std::sync::Arc; use std::time::Duration; use async_stream::try_stream; use futures::future::Either; use futures_util::{StreamExt, TryStreamExt}; use pageserver::tenant::IndexPart; use pageserver::tenant::remote_timeline_client::index::LayerFileMetadata; use page...
rust
Apache-2.0
015b1c7cb3259a6fcd5039bc2bd46a462e163ae8
2026-01-04T15:40:24.223849Z
false
neondatabase/neon
https://github.com/neondatabase/neon/blob/015b1c7cb3259a6fcd5039bc2bd46a462e163ae8/storage_scrubber/src/lib.rs
storage_scrubber/src/lib.rs
#![deny(unsafe_code)] #![deny(clippy::undocumented_unsafe_blocks)] pub mod checks; pub mod cloud_admin_api; pub mod find_large_objects; pub mod garbage; pub mod metadata_stream; pub mod pageserver_physical_gc; pub mod scan_pageserver_metadata; pub mod scan_safekeeper_metadata; pub mod tenant_snapshot; use std::env; us...
rust
Apache-2.0
015b1c7cb3259a6fcd5039bc2bd46a462e163ae8
2026-01-04T15:40:24.223849Z
false
neondatabase/neon
https://github.com/neondatabase/neon/blob/015b1c7cb3259a6fcd5039bc2bd46a462e163ae8/storage_scrubber/src/checks.rs
storage_scrubber/src/checks.rs
use std::collections::{HashMap, HashSet}; use std::time::SystemTime; use futures_util::StreamExt; use itertools::Itertools; use pageserver::tenant::IndexPart; use pageserver::tenant::checks::check_valid_layermap; use pageserver::tenant::layer_map::LayerMap; use pageserver::tenant::remote_timeline_client::index::LayerF...
rust
Apache-2.0
015b1c7cb3259a6fcd5039bc2bd46a462e163ae8
2026-01-04T15:40:24.223849Z
false
neondatabase/neon
https://github.com/neondatabase/neon/blob/015b1c7cb3259a6fcd5039bc2bd46a462e163ae8/storage_scrubber/src/scan_pageserver_metadata.rs
storage_scrubber/src/scan_pageserver_metadata.rs
use std::collections::{HashMap, HashSet}; use futures_util::{StreamExt, TryStreamExt}; use pageserver::tenant::remote_timeline_client::remote_layer_path; use pageserver_api::controller_api::MetadataHealthUpdateRequest; use pageserver_api::shard::TenantShardId; use remote_storage::GenericRemoteStorage; use serde::Seria...
rust
Apache-2.0
015b1c7cb3259a6fcd5039bc2bd46a462e163ae8
2026-01-04T15:40:24.223849Z
false
neondatabase/neon
https://github.com/neondatabase/neon/blob/015b1c7cb3259a6fcd5039bc2bd46a462e163ae8/storage_scrubber/src/scan_safekeeper_metadata.rs
storage_scrubber/src/scan_safekeeper_metadata.rs
use std::collections::HashSet; use std::str::FromStr; use std::sync::Arc; use anyhow::{Context, bail}; use futures::stream::{StreamExt, TryStreamExt}; use once_cell::sync::OnceCell; use pageserver_api::shard::TenantShardId; use postgres_ffi::{PG_TLI, XLogFileName}; use remote_storage::GenericRemoteStorage; use rustls:...
rust
Apache-2.0
015b1c7cb3259a6fcd5039bc2bd46a462e163ae8
2026-01-04T15:40:24.223849Z
false
neondatabase/neon
https://github.com/neondatabase/neon/blob/015b1c7cb3259a6fcd5039bc2bd46a462e163ae8/storage_scrubber/src/cloud_admin_api.rs
storage_scrubber/src/cloud_admin_api.rs
use std::error::Error as _; use chrono::{DateTime, Utc}; use futures::Future; use hex::FromHex; use reqwest::{Client, StatusCode, Url, header}; use serde::Deserialize; use tokio::sync::Semaphore; use tokio_util::sync::CancellationToken; use utils::backoff; use utils::id::{TenantId, TimelineId}; use utils::lsn::Lsn; u...
rust
Apache-2.0
015b1c7cb3259a6fcd5039bc2bd46a462e163ae8
2026-01-04T15:40:24.223849Z
false
neondatabase/neon
https://github.com/neondatabase/neon/blob/015b1c7cb3259a6fcd5039bc2bd46a462e163ae8/storage_scrubber/src/garbage.rs
storage_scrubber/src/garbage.rs
//! Functionality for finding and purging garbage, as in "garbage collection". //! //! Garbage means S3 objects which are either not referenced by any metadata, //! or are referenced by a control plane tenant/timeline in a deleted state. use std::collections::{HashMap, HashSet}; use std::sync::Arc; use std::time::Dura...
rust
Apache-2.0
015b1c7cb3259a6fcd5039bc2bd46a462e163ae8
2026-01-04T15:40:24.223849Z
false
neondatabase/neon
https://github.com/neondatabase/neon/blob/015b1c7cb3259a6fcd5039bc2bd46a462e163ae8/storage_scrubber/src/metadata_stream.rs
storage_scrubber/src/metadata_stream.rs
use std::str::FromStr; use anyhow::{Context, anyhow}; use async_stream::{stream, try_stream}; use futures::StreamExt; use pageserver_api::shard::TenantShardId; use remote_storage::{GenericRemoteStorage, ListingMode, ListingObject, RemotePath}; use tokio_stream::Stream; use utils::id::{TenantId, TimelineId}; use crate...
rust
Apache-2.0
015b1c7cb3259a6fcd5039bc2bd46a462e163ae8
2026-01-04T15:40:24.223849Z
false
neondatabase/neon
https://github.com/neondatabase/neon/blob/015b1c7cb3259a6fcd5039bc2bd46a462e163ae8/storage_scrubber/src/main.rs
storage_scrubber/src/main.rs
use anyhow::{Context, anyhow, bail}; use camino::Utf8PathBuf; use clap::{Parser, Subcommand}; use pageserver_api::controller_api::{MetadataHealthUpdateRequest, MetadataHealthUpdateResponse}; use pageserver_api::shard::TenantShardId; use reqwest::{Certificate, Method, Url}; use storage_controller_client::control_api; us...
rust
Apache-2.0
015b1c7cb3259a6fcd5039bc2bd46a462e163ae8
2026-01-04T15:40:24.223849Z
false
neondatabase/neon
https://github.com/neondatabase/neon/blob/015b1c7cb3259a6fcd5039bc2bd46a462e163ae8/storage_scrubber/src/find_large_objects.rs
storage_scrubber/src/find_large_objects.rs
use std::pin::pin; use futures::{StreamExt, TryStreamExt}; use pageserver::tenant::storage_layer::LayerName; use remote_storage::ListingMode; use serde::{Deserialize, Serialize}; use crate::checks::parse_layer_object_name; use crate::metadata_stream::stream_tenants; use crate::{BucketConfig, NodeKind, init_remote, st...
rust
Apache-2.0
015b1c7cb3259a6fcd5039bc2bd46a462e163ae8
2026-01-04T15:40:24.223849Z
false
neondatabase/neon
https://github.com/neondatabase/neon/blob/015b1c7cb3259a6fcd5039bc2bd46a462e163ae8/storage_scrubber/src/tenant_snapshot.rs
storage_scrubber/src/tenant_snapshot.rs
use std::collections::HashMap; use anyhow::Context; use async_stream::stream; use camino::Utf8PathBuf; use futures::{StreamExt, TryStreamExt}; use pageserver::tenant::IndexPart; use pageserver::tenant::remote_timeline_client::index::LayerFileMetadata; use pageserver::tenant::remote_timeline_client::remote_layer_path; ...
rust
Apache-2.0
015b1c7cb3259a6fcd5039bc2bd46a462e163ae8
2026-01-04T15:40:24.223849Z
false
neondatabase/neon
https://github.com/neondatabase/neon/blob/015b1c7cb3259a6fcd5039bc2bd46a462e163ae8/safekeeper/src/hadron.rs
safekeeper/src/hadron.rs
use once_cell::sync::Lazy; use pem::Pem; use safekeeper_api::models::PullTimelineRequest; use std::{ collections::HashMap, env::VarError, net::IpAddr, sync::Arc, sync::atomic::AtomicBool, time::Duration, }; use tokio::time::sleep; use tokio_util::sync::CancellationToken; use url::Url; use utils::{backoff, criti...
rust
Apache-2.0
015b1c7cb3259a6fcd5039bc2bd46a462e163ae8
2026-01-04T15:40:24.223849Z
false
neondatabase/neon
https://github.com/neondatabase/neon/blob/015b1c7cb3259a6fcd5039bc2bd46a462e163ae8/safekeeper/src/receive_wal.rs
safekeeper/src/receive_wal.rs
//! Safekeeper communication endpoint to WAL proposer (compute node). //! Gets messages from the network, passes them down to consensus module and //! sends replies back. use std::future; use std::net::SocketAddr; use std::sync::Arc; use anyhow::{Context, anyhow}; use bytes::BytesMut; use parking_lot::{MappedMutexGua...
rust
Apache-2.0
015b1c7cb3259a6fcd5039bc2bd46a462e163ae8
2026-01-04T15:40:24.223849Z
false
neondatabase/neon
https://github.com/neondatabase/neon/blob/015b1c7cb3259a6fcd5039bc2bd46a462e163ae8/safekeeper/src/timeline_guard.rs
safekeeper/src/timeline_guard.rs
//! Timeline residence guard //! //! It is needed to ensure that WAL segments are present on disk, //! as long as the code is holding the guard. This file implements guard logic, to issue //! and drop guards, and to notify the manager when the guard is dropped. use std::collections::HashSet; use tracing::debug; use u...
rust
Apache-2.0
015b1c7cb3259a6fcd5039bc2bd46a462e163ae8
2026-01-04T15:40:24.223849Z
false
neondatabase/neon
https://github.com/neondatabase/neon/blob/015b1c7cb3259a6fcd5039bc2bd46a462e163ae8/safekeeper/src/rate_limit.rs
safekeeper/src/rate_limit.rs
use std::sync::Arc; use rand::Rng; use crate::metrics::MISC_OPERATION_SECONDS; /// Global rate limiter for background tasks. #[derive(Clone)] pub struct RateLimiter { partial_backup: Arc<tokio::sync::Semaphore>, eviction: Arc<tokio::sync::Semaphore>, } impl RateLimiter { /// Create a new rate limiter. ...
rust
Apache-2.0
015b1c7cb3259a6fcd5039bc2bd46a462e163ae8
2026-01-04T15:40:24.223849Z
false
neondatabase/neon
https://github.com/neondatabase/neon/blob/015b1c7cb3259a6fcd5039bc2bd46a462e163ae8/safekeeper/src/timelines_global_map.rs
safekeeper/src/timelines_global_map.rs
//! This module contains global `(tenant_id, timeline_id)` -> `Arc<Timeline>` mapping. //! All timelines should always be present in this map, this is done by loading them //! all from the disk on startup and keeping them in memory. use std::collections::HashMap; use std::str::FromStr; use std::sync::{Arc, Mutex}; use...
rust
Apache-2.0
015b1c7cb3259a6fcd5039bc2bd46a462e163ae8
2026-01-04T15:40:24.223849Z
false
neondatabase/neon
https://github.com/neondatabase/neon/blob/015b1c7cb3259a6fcd5039bc2bd46a462e163ae8/safekeeper/src/lib.rs
safekeeper/src/lib.rs
#![deny(clippy::undocumented_unsafe_blocks)] extern crate hyper0 as hyper; use std::time::Duration; use camino::Utf8PathBuf; use once_cell::sync::Lazy; use pem::Pem; use remote_storage::RemoteStorageConfig; use storage_broker::Uri; use tokio::runtime::Runtime; use url::Url; use utils::auth::SwappableJwtAuth; use uti...
rust
Apache-2.0
015b1c7cb3259a6fcd5039bc2bd46a462e163ae8
2026-01-04T15:40:24.223849Z
false
neondatabase/neon
https://github.com/neondatabase/neon/blob/015b1c7cb3259a6fcd5039bc2bd46a462e163ae8/safekeeper/src/wal_service.rs
safekeeper/src/wal_service.rs
//! //! WAL service listens for client connections and //! receive WAL from wal_proposer and send it to WAL receivers //! use std::os::fd::AsRawFd; use std::sync::Arc; use std::time::Duration; use anyhow::{Context, Result}; use postgres_backend::{AuthType, PostgresBackend, QueryError}; use safekeeper_api::models::...
rust
Apache-2.0
015b1c7cb3259a6fcd5039bc2bd46a462e163ae8
2026-01-04T15:40:24.223849Z
false
neondatabase/neon
https://github.com/neondatabase/neon/blob/015b1c7cb3259a6fcd5039bc2bd46a462e163ae8/safekeeper/src/debug_dump.rs
safekeeper/src/debug_dump.rs
//! Utils for dumping full state of the safekeeper. use std::fs; use std::fs::DirEntry; use std::io::{BufReader, Read}; use std::path::PathBuf; use std::sync::Arc; use anyhow::{Result, bail}; use camino::{Utf8Path, Utf8PathBuf}; use chrono::{DateTime, Utc}; use postgres_ffi::v14::xlog_utils::{IsPartialXLogFileName, I...
rust
Apache-2.0
015b1c7cb3259a6fcd5039bc2bd46a462e163ae8
2026-01-04T15:40:24.223849Z
false
neondatabase/neon
https://github.com/neondatabase/neon/blob/015b1c7cb3259a6fcd5039bc2bd46a462e163ae8/safekeeper/src/state.rs
safekeeper/src/state.rs
//! Defines per timeline data stored persistently (SafeKeeperPersistentState) //! and its wrapper with in memory layer (SafekeeperState). use std::cmp::max; use std::ops::Deref; use std::time::SystemTime; use anyhow::{Result, bail}; use postgres_ffi::WAL_SEGMENT_SIZE; use postgres_versioninfo::{PgMajorVersion, PgVers...
rust
Apache-2.0
015b1c7cb3259a6fcd5039bc2bd46a462e163ae8
2026-01-04T15:40:24.223849Z
false
neondatabase/neon
https://github.com/neondatabase/neon/blob/015b1c7cb3259a6fcd5039bc2bd46a462e163ae8/safekeeper/src/safekeeper.rs
safekeeper/src/safekeeper.rs
//! Acceptor part of proposer-acceptor consensus algorithm. use std::cmp::{max, min}; use std::fmt; use std::io::Read; use std::str::FromStr; use anyhow::{Context, Result, bail}; use byteorder::{LittleEndian, ReadBytesExt}; use bytes::{Buf, BufMut, Bytes, BytesMut}; use postgres_ffi::{MAX_SEND_SIZE, TimeLineID}; use ...
rust
Apache-2.0
015b1c7cb3259a6fcd5039bc2bd46a462e163ae8
2026-01-04T15:40:24.223849Z
true
neondatabase/neon
https://github.com/neondatabase/neon/blob/015b1c7cb3259a6fcd5039bc2bd46a462e163ae8/safekeeper/src/test_utils.rs
safekeeper/src/test_utils.rs
use std::ffi::CStr; use std::sync::Arc; use camino_tempfile::Utf8TempDir; use postgres_ffi::v17::wal_generator::{LogicalMessageGenerator, WalGenerator}; use safekeeper_api::membership::SafekeeperGeneration as Generation; use tokio::fs::create_dir_all; use utils::id::{NodeId, TenantTimelineId}; use utils::lsn::Lsn; us...
rust
Apache-2.0
015b1c7cb3259a6fcd5039bc2bd46a462e163ae8
2026-01-04T15:40:24.223849Z
false
neondatabase/neon
https://github.com/neondatabase/neon/blob/015b1c7cb3259a6fcd5039bc2bd46a462e163ae8/safekeeper/src/remove_wal.rs
safekeeper/src/remove_wal.rs
use utils::lsn::Lsn; use crate::timeline_manager::StateSnapshot; /// Get oldest LSN we still need to keep. /// /// We hold WAL till it is consumed by /// 1) pageserver (remote_consistent_lsn) /// 2) s3 offloading. /// 3) Additionally we must store WAL since last local commit_lsn because /// that's where we start l...
rust
Apache-2.0
015b1c7cb3259a6fcd5039bc2bd46a462e163ae8
2026-01-04T15:40:24.223849Z
false
neondatabase/neon
https://github.com/neondatabase/neon/blob/015b1c7cb3259a6fcd5039bc2bd46a462e163ae8/safekeeper/src/timeline_eviction.rs
safekeeper/src/timeline_eviction.rs
//! Code related to evicting WAL files to remote storage. //! //! The actual upload is done by the partial WAL backup code. This file has //! code to delete and re-download WAL files, cross-validate with partial WAL //! backup if local file is still present. use anyhow::Context; use camino::Utf8PathBuf; use remote_sto...
rust
Apache-2.0
015b1c7cb3259a6fcd5039bc2bd46a462e163ae8
2026-01-04T15:40:24.223849Z
false
neondatabase/neon
https://github.com/neondatabase/neon/blob/015b1c7cb3259a6fcd5039bc2bd46a462e163ae8/safekeeper/src/timelines_set.rs
safekeeper/src/timelines_set.rs
use std::collections::HashMap; use std::sync::Arc; use utils::id::TenantTimelineId; use crate::timeline::Timeline; /// Set of timelines, supports operations: /// - add timeline /// - remove timeline /// - clone the set /// /// Usually used for keeping subset of timelines. For example active timelines that require br...
rust
Apache-2.0
015b1c7cb3259a6fcd5039bc2bd46a462e163ae8
2026-01-04T15:40:24.223849Z
false
neondatabase/neon
https://github.com/neondatabase/neon/blob/015b1c7cb3259a6fcd5039bc2bd46a462e163ae8/safekeeper/src/copy_timeline.rs
safekeeper/src/copy_timeline.rs
use std::sync::Arc; use anyhow::{Result, bail}; use camino::Utf8PathBuf; use postgres_ffi::{MAX_SEND_SIZE, WAL_SEGMENT_SIZE}; use remote_storage::GenericRemoteStorage; use safekeeper_api::membership::Configuration; use tokio::fs::OpenOptions; use tokio::io::{AsyncSeekExt, AsyncWriteExt}; use tracing::{info, warn}; use...
rust
Apache-2.0
015b1c7cb3259a6fcd5039bc2bd46a462e163ae8
2026-01-04T15:40:24.223849Z
false
neondatabase/neon
https://github.com/neondatabase/neon/blob/015b1c7cb3259a6fcd5039bc2bd46a462e163ae8/safekeeper/src/control_file.rs
safekeeper/src/control_file.rs
//! Control file serialization, deserialization and persistence. use std::future::Future; use std::io::Read; use std::ops::Deref; use std::path::Path; use std::time::Instant; use anyhow::{Context, Result, bail, ensure}; use byteorder::{LittleEndian, ReadBytesExt, WriteBytesExt}; use camino::{Utf8Path, Utf8PathBuf}; u...
rust
Apache-2.0
015b1c7cb3259a6fcd5039bc2bd46a462e163ae8
2026-01-04T15:40:24.223849Z
false
neondatabase/neon
https://github.com/neondatabase/neon/blob/015b1c7cb3259a6fcd5039bc2bd46a462e163ae8/safekeeper/src/wal_backup.rs
safekeeper/src/wal_backup.rs
use std::cmp::min; use std::collections::HashSet; use std::num::NonZeroU32; use std::pin::Pin; use std::sync::Arc; use std::time::Duration; use anyhow::{Context, Result}; use camino::{Utf8Path, Utf8PathBuf}; use futures::StreamExt; use futures::stream::{self, FuturesOrdered}; use postgres_ffi::v14::xlog_utils::XLogSeg...
rust
Apache-2.0
015b1c7cb3259a6fcd5039bc2bd46a462e163ae8
2026-01-04T15:40:24.223849Z
false
neondatabase/neon
https://github.com/neondatabase/neon/blob/015b1c7cb3259a6fcd5039bc2bd46a462e163ae8/safekeeper/src/auth.rs
safekeeper/src/auth.rs
use utils::auth::{AuthError, Claims, Scope}; use utils::id::TenantId; /// If tenant_id is provided, allow if token (claims) is for this tenant or /// whole safekeeper scope (SafekeeperData). Else, allow only if token is /// SafekeeperData. pub fn check_permission(claims: &Claims, tenant_id: Option<TenantId>) -> Result...
rust
Apache-2.0
015b1c7cb3259a6fcd5039bc2bd46a462e163ae8
2026-01-04T15:40:24.223849Z
false
neondatabase/neon
https://github.com/neondatabase/neon/blob/015b1c7cb3259a6fcd5039bc2bd46a462e163ae8/safekeeper/src/timeline.rs
safekeeper/src/timeline.rs
//! This module implements Timeline lifecycle management and has all necessary code //! to glue together SafeKeeper and all other background services. use std::cmp::max; use std::ops::{Deref, DerefMut}; use std::sync::Arc; use std::sync::atomic::{AtomicBool, AtomicU64, Ordering}; use std::time::Duration; use anyhow::...
rust
Apache-2.0
015b1c7cb3259a6fcd5039bc2bd46a462e163ae8
2026-01-04T15:40:24.223849Z
true
neondatabase/neon
https://github.com/neondatabase/neon/blob/015b1c7cb3259a6fcd5039bc2bd46a462e163ae8/safekeeper/src/wal_reader_stream.rs
safekeeper/src/wal_reader_stream.rs
use std::pin::Pin; use std::task::{Context, Poll}; use crate::send_wal::EndWatch; use crate::timeline::WalResidentTimeline; use crate::wal_storage::WalReader; use bytes::Bytes; use futures::stream::BoxStream; use futures::{Stream, StreamExt}; use safekeeper_api::Term; use utils::id::TenantTimelineId; use utils::lsn::L...
rust
Apache-2.0
015b1c7cb3259a6fcd5039bc2bd46a462e163ae8
2026-01-04T15:40:24.223849Z
false
neondatabase/neon
https://github.com/neondatabase/neon/blob/015b1c7cb3259a6fcd5039bc2bd46a462e163ae8/safekeeper/src/timeline_manager.rs
safekeeper/src/timeline_manager.rs
//! The timeline manager task is responsible for managing the timeline's background tasks. //! //! It is spawned alongside each timeline and exits when the timeline is deleted. //! It watches for changes in the timeline state and decides when to spawn or kill background tasks. //! It also can manage some reactive state...
rust
Apache-2.0
015b1c7cb3259a6fcd5039bc2bd46a462e163ae8
2026-01-04T15:40:24.223849Z
false
neondatabase/neon
https://github.com/neondatabase/neon/blob/015b1c7cb3259a6fcd5039bc2bd46a462e163ae8/safekeeper/src/metrics.rs
safekeeper/src/metrics.rs
//! Global safekeeper mertics and per-timeline safekeeper metrics. use std::sync::{Arc, RwLock}; use std::time::{Instant, SystemTime}; use anyhow::Result; use futures::Future; use metrics::core::{AtomicU64, Collector, Desc, GenericCounter, GenericGaugeVec, Opts}; use metrics::proto::MetricFamily; use metrics::{ D...
rust
Apache-2.0
015b1c7cb3259a6fcd5039bc2bd46a462e163ae8
2026-01-04T15:40:24.223849Z
true
neondatabase/neon
https://github.com/neondatabase/neon/blob/015b1c7cb3259a6fcd5039bc2bd46a462e163ae8/safekeeper/src/send_interpreted_wal.rs
safekeeper/src/send_interpreted_wal.rs
use std::collections::HashMap; use std::fmt::Display; use std::sync::Arc; use std::sync::atomic::AtomicBool; use std::time::Duration; use anyhow::{Context, anyhow}; use futures::StreamExt; use futures::future::Either; use pageserver_api::shard::ShardIdentity; use postgres_backend::{CopyStreamHandlerEnd, PostgresBacken...
rust
Apache-2.0
015b1c7cb3259a6fcd5039bc2bd46a462e163ae8
2026-01-04T15:40:24.223849Z
true
neondatabase/neon
https://github.com/neondatabase/neon/blob/015b1c7cb3259a6fcd5039bc2bd46a462e163ae8/safekeeper/src/broker.rs
safekeeper/src/broker.rs
//! Communication with the broker, providing safekeeper peers and pageserver coordination. use std::sync::Arc; use std::sync::atomic::AtomicU64; use std::time::{Duration, Instant, UNIX_EPOCH}; use anyhow::{Context, Error, Result, anyhow, bail}; use storage_broker::proto::subscribe_safekeeper_info_request::Subscriptio...
rust
Apache-2.0
015b1c7cb3259a6fcd5039bc2bd46a462e163ae8
2026-01-04T15:40:24.223849Z
false
neondatabase/neon
https://github.com/neondatabase/neon/blob/015b1c7cb3259a6fcd5039bc2bd46a462e163ae8/safekeeper/src/handler.rs
safekeeper/src/handler.rs
//! Part of Safekeeper pretending to be Postgres, i.e. handling Postgres //! protocol commands. use std::future::Future; use std::str::{self, FromStr}; use std::sync::Arc; use anyhow::Context; use jsonwebtoken::TokenData; use pageserver_api::models::ShardParameters; use pageserver_api::shard::{ShardIdentity, ShardStr...
rust
Apache-2.0
015b1c7cb3259a6fcd5039bc2bd46a462e163ae8
2026-01-04T15:40:24.223849Z
false