Skip to content
Closed
Show file tree
Hide file tree
Changes from all commits
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
6 changes: 3 additions & 3 deletions .github/workflows/build-packages.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -75,7 +75,7 @@ jobs:
- name: Install packages
run: |
apt-get update && apt-get install git cmake wget build-essential pkg-config libssl-dev clang g++ perl patch -y --option=Dpkg::Options::=--force-confdef &&
wget -q https://static.rust-lang.org/dist/rust-1.87.0-x86_64-unknown-linux-gnu.tar.gz -O /tmp/rust.tar.gz &&
wget -q https://static.rust-lang.org/dist/rust-1.95.0-x86_64-unknown-linux-gnu.tar.gz -O /tmp/rust.tar.gz &&
cd /tmp && tar xf rust.tar.gz && ./rust-*-x86_64-unknown-linux-gnu/install.sh
- name: Build binaries in release mode
run: JEMALLOC_SYS_WITH_MALLOC_CONF="dirty_decay_ms:30000,muzzy_decay_ms:30000,background_thread:true,metadata_thp:auto" cargo build --release
Expand Down Expand Up @@ -119,7 +119,7 @@ jobs:
- name: Install packages
run: |
yum install -y @"Development Tools" openssl-devel wget perl patch &&
wget -q https://static.rust-lang.org/dist/rust-1.87.0-x86_64-unknown-linux-gnu.tar.gz -O /tmp/rust.tar.gz &&
wget -q https://static.rust-lang.org/dist/rust-1.95.0-x86_64-unknown-linux-gnu.tar.gz -O /tmp/rust.tar.gz &&
cd /tmp && tar xf rust.tar.gz && ./rust-*-x86_64-unknown-linux-gnu/install.sh
- name: Build binaries in release mode
run: JEMALLOC_SYS_WITH_MALLOC_CONF="dirty_decay_ms:30000,muzzy_decay_ms:30000,background_thread:true,metadata_thp:auto" cargo build --release
Expand Down Expand Up @@ -151,7 +151,7 @@ jobs:
needs: [verify-version]
runs-on: ubuntu-latest
container:
image: rust:1.87.0-alpine
image: rust:1.95.0-alpine
env:
JEMALLOC_SYS_WITH_MALLOC_CONF: "dirty_decay_ms:30000,muzzy_decay_ms:30000,background_thread:true,metadata_thp:auto"
OPENSSL_STATIC: "1"
Expand Down
2 changes: 1 addition & 1 deletion .github/workflows/copr-publish.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,7 @@ env:
# EPEL versions (RHEL/CentOS/Rocky/Alma)
EPEL_VERSIONS: "8 9"
COPR_PROJECT: "pg-doorman"
RUST_VERSION: "1.87.0"
RUST_VERSION: "1.95.0"

jobs:
verify-version:
Expand Down
2 changes: 1 addition & 1 deletion .github/workflows/launchpad-publish.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,7 @@ env:
# questing = 25.10
# resolute = 26.04 LTS
PPA_NAME: "ppa:vadv/pg-doorman"
RUST_VERSION: "1.87.0"
RUST_VERSION: "1.95.0"
# Rebuild number for Launchpad PPA uploads
# Increment this when you need to re-upload the same version
# (e.g., after fixing packaging issues without changing the actual version)
Expand Down
30 changes: 15 additions & 15 deletions Cargo.lock

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

8 changes: 4 additions & 4 deletions Cargo.toml
Original file line number Diff line number Diff line change
@@ -1,8 +1,8 @@
[package]
name = "pg_doorman"
version = "3.6.3"
edition = "2021"
rust-version = "1.87.0"
version = "3.7.0"
edition = "2024"
rust-version = "1.95.0"
license = "MIT"


Expand Down Expand Up @@ -30,7 +30,7 @@ quanta = "0.12"
arc-swap = "1.7.1"
toml = "0.8"
prometheus = "0.14.0"
tokio = { version = "1.48.4", features = ["rt-multi-thread", "fs", "parking_lot", "sync", "io-util", "net", "macros", "signal", "time"] }
tokio = { version = "1.52.1", features = ["rt-multi-thread", "fs", "parking_lot", "sync", "io-util", "net", "macros", "signal", "time"] }
exitcode = "1.1.2"
pin-project = "1"
bytes = "1.10.1"
Expand Down
2 changes: 1 addition & 1 deletion Dockerfile
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
FROM rust:1.87.0-slim-bookworm AS builder
FROM rust:1.95.0-slim-bookworm AS builder

RUN apt-get update && \
apt-get install -y build-essential pkg-config libssl-dev perl
Expand Down
2 changes: 1 addition & 1 deletion benches/cache_benchmarks.rs
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
use criterion::{criterion_group, criterion_main, BenchmarkId, Criterion, Throughput};
use criterion::{BenchmarkId, Criterion, Throughput, criterion_group, criterion_main};
use std::sync::Arc;

use pg_doorman::auth::auth_query::{AuthQueryCache, PasswordFetcher};
Expand Down
2 changes: 1 addition & 1 deletion benches/coordinator_benchmarks.rs
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
use criterion::{criterion_group, criterion_main, BenchmarkId, Criterion, Throughput};
use criterion::{BenchmarkId, Criterion, Throughput, criterion_group, criterion_main};
use std::sync::Arc;
use tokio::sync::Semaphore;

Expand Down
2 changes: 1 addition & 1 deletion benches/hash_benchmarks.rs
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
use criterion::{criterion_group, criterion_main, Criterion, Throughput};
use criterion::{Criterion, Throughput, criterion_group, criterion_main};
use std::collections::hash_map::DefaultHasher;
use std::hash::Hasher;
use xxhash_rust::xxh3::Xxh3;
Expand Down
2 changes: 1 addition & 1 deletion benches/log_benchmarks.rs
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
use criterion::{criterion_group, criterion_main, Criterion, Throughput};
use criterion::{Criterion, Throughput, criterion_group, criterion_main};
use log::Log;
use std::io::Write;
use std::sync::atomic::{AtomicU64, Ordering};
Expand Down
2 changes: 1 addition & 1 deletion benches/memory_benchmarks.rs
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
use bytes::BytesMut;
use criterion::{criterion_group, criterion_main, BenchmarkId, Criterion, Throughput};
use criterion::{BenchmarkId, Criterion, Throughput, criterion_group, criterion_main};

fn bytesmut_allocation(c: &mut Criterion) {
let mut group = c.benchmark_group("bytesmut_alloc");
Expand Down
4 changes: 2 additions & 2 deletions benches/pool_anticipation_benchmarks.rs
Original file line number Diff line number Diff line change
Expand Up @@ -19,9 +19,9 @@
//! them private avoids leaking test/bench scaffolding into the public API
//! surface, and the duplication is twenty trivial lines.

use criterion::{criterion_group, criterion_main, BenchmarkId, Criterion, Throughput};
use std::sync::atomic::{AtomicUsize, Ordering};
use criterion::{BenchmarkId, Criterion, Throughput, criterion_group, criterion_main};
use std::sync::Arc;
use std::sync::atomic::{AtomicUsize, Ordering};
use std::time::Duration;
use tokio::sync::Notify;

Expand Down
4 changes: 2 additions & 2 deletions benches/setup-and-run-bench.sh
Original file line number Diff line number Diff line change
Expand Up @@ -93,9 +93,9 @@ install_rust() {
log "Rust already present: $(cargo --version)"
return
fi
log "Installing rustup 1.87.0"
log "Installing rustup 1.95.0"
curl --proto '=https' --tlsv1.2 -sSf https://sh.rustup.rs \
| sh -s -- -y --default-toolchain 1.87.0 --profile minimal
| sh -s -- -y --default-toolchain 1.95.0 --profile minimal
# shellcheck disable=SC1091
source "$HOME/.cargo/env"
}
Expand Down
11 changes: 11 additions & 0 deletions documentation/en/src/changelog.md
Original file line number Diff line number Diff line change
@@ -1,5 +1,16 @@
# Changelog

### 3.7.0 <small>Apr 30, 2026</small>

#### Toolchain refresh — Rust 1.95, tokio 1.52, edition 2024

Internal release. The project moves to current Rust toolchain and async-runtime defaults; no user-facing behavior changes. Operators upgrading from 3.6.x do not need any config or deployment changes.

- **Rust toolchain**: 1.87.0 → 1.95.0. `rust-version` in Cargo.toml bumped accordingly.
- **tokio**: 1.49 → 1.52.
- **Edition 2024**. Source-level adjustments where 2024 changed defaults: `std::env::remove_var` is now wrapped in unsafe blocks (it can race with concurrent reads from other threads), `unsafe fn` bodies open explicit `unsafe { ... }` blocks, redundant `ref` bindings dropped from if-let patterns.
- **Clippy lints surfaced under 1.95 + 2024 are resolved**. Bulk auto-rewrites collapsed nested `if`s into 2024 stable let-chains; manual fixes replaced `is_some + unwrap` with `if let`, manual zero-checked division with `checked_div().unwrap_or(default)`, and `sort_by(reverse-cmp)` with `sort_by_key(Reverse)`.

### 3.6.4 <small>Apr 29, 2026</small>

#### Fallback resilience
Expand Down
2 changes: 1 addition & 1 deletion documentation/en/src/tutorials/contributing.md
Original file line number Diff line number Diff line change
Expand Up @@ -68,7 +68,7 @@ The test Docker image (built with Nix) includes:
- Python 3 with asyncpg, psycopg2, aiopg, pytest
- Node.js 22
- .NET SDK 8
- Rust 1.87.0
- Rust 1.95.0

### Running Tests

Expand Down
2 changes: 1 addition & 1 deletion documentation/ru/src/tutorials/contributing.md
Original file line number Diff line number Diff line change
Expand Up @@ -68,7 +68,7 @@ PgDoorman использует BDD-тесты (Behavior-Driven Development) с
- Python 3 с asyncpg, psycopg2, aiopg, pytest
- Node.js 22
- .NET SDK 8
- Rust 1.87.0
- Rust 1.95.0

### Запуск тестов

Expand Down
2 changes: 1 addition & 1 deletion pkg/rpm/pg-doorman.spec
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
%global debug_package %{nil}
%global rust_version 1.87.0
%global rust_version 1.95.0

Name: pg-doorman
Version: 3.0.0
Expand Down
2 changes: 1 addition & 1 deletion rust-toolchain.toml
Original file line number Diff line number Diff line change
@@ -1,2 +1,2 @@
[toolchain]
channel = "1.87.0"
channel = "1.95.0"
50 changes: 25 additions & 25 deletions src/admin/commands.rs
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@ use crate::errors::Error;
use crate::messages::protocol::{command_complete, data_row, row_description};
use crate::messages::socket::write_all_half;
use crate::messages::types::DataType;
use crate::pool::{get_all_pools, ClientServerMap, PoolMap};
use crate::pool::{ClientServerMap, PoolMap, get_all_pools};

/// Reload the configuration file without restarting the process.
pub async fn reload<T>(stream: &mut T, client_server_map: ClientServerMap) -> Result<(), Error>
Expand Down Expand Up @@ -42,7 +42,7 @@ where
{
let mut res = BytesMut::new();

res.put(row_description(&vec![("success", DataType::Text)]));
res.put(row_description(&[("success", DataType::Text)]));

let mut shutdown_success = "t";

Expand Down Expand Up @@ -71,7 +71,7 @@ where
{
let mut res = BytesMut::new();

res.put(row_description(&vec![("success", DataType::Text)]));
res.put(row_description(&[("success", DataType::Text)]));

let mut upgrade_success = "t";

Expand Down Expand Up @@ -133,16 +133,16 @@ async fn check_db_has_pools<T>(
where
T: tokio::io::AsyncWrite + std::marker::Unpin,
{
if let Some(ref db_name) = db {
if !pools.keys().any(|id| id.db == *db_name) {
admin_error_response(
stream,
&format!("No pool for database \"{}\"", db_name),
"3D000",
)
.await?;
return Ok(false);
}
if let Some(db_name) = db
&& !pools.keys().any(|id| id.db == *db_name)
{
admin_error_response(
stream,
&format!("No pool for database \"{}\"", db_name),
"3D000",
)
.await?;
return Ok(false);
}
Ok(true)
}
Expand All @@ -159,10 +159,10 @@ where
return Ok(());
}
for (identifier, pool) in pools.iter() {
if let Some(ref db_name) = db {
if identifier.db != *db_name {
continue;
}
if let Some(ref db_name) = db
&& identifier.db != *db_name
{
continue;
}
pool.database.pause();
info!("PAUSE: paused pool {}", identifier);
Expand All @@ -187,10 +187,10 @@ where
return Ok(());
}
for (identifier, pool) in pools.iter() {
if let Some(ref db_name) = db {
if identifier.db != *db_name {
continue;
}
if let Some(ref db_name) = db
&& identifier.db != *db_name
{
continue;
}
pool.database.resume();
info!("RESUME: resumed pool {}", identifier);
Expand All @@ -216,10 +216,10 @@ where
return Ok(());
}
for (identifier, pool) in pools.iter() {
if let Some(ref db_name) = db {
if identifier.db != *db_name {
continue;
}
if let Some(ref db_name) = db
&& identifier.db != *db_name
{
continue;
}
let new_epoch = pool.database.reconnect();
info!(
Expand Down
8 changes: 4 additions & 4 deletions src/admin/mod.rs
Original file line number Diff line number Diff line change
Expand Up @@ -174,21 +174,21 @@ where

if query_lower.contains("unnest(enumvals)") {
// SET log_level = <TAB> — return enum values for the parameter
res.put(row_description(&vec![("val", DataType::Text)]));
res.put(row_description(&[("val", DataType::Text)]));
for val in &["error", "warn", "info", "debug", "trace", "off", "default"] {
res.put(data_row(&[val.to_string()]));
}
} else if query_lower.contains("vartype") {
// Type lookup — psql checks if parameter is enum/bool/string
res.put(row_description(&vec![("vartype", DataType::Text)]));
res.put(row_description(&[("vartype", DataType::Text)]));
res.put(data_row(&["enum".to_string()]));
} else if query_lower.contains("context") {
// SET <TAB> — return settable parameters (filtered by context)
res.put(row_description(&vec![("name", DataType::Text)]));
res.put(row_description(&[("name", DataType::Text)]));
res.put(data_row(&["log_level".to_string()]));
} else {
// SHOW <TAB> — return all SHOW subcommands from the canonical list
res.put(row_description(&vec![("name", DataType::Text)]));
res.put(row_description(&[("name", DataType::Text)]));
for name in SHOW_SUBCOMMANDS {
res.put(data_row(&[name.to_string()]));
}
Expand Down
Loading
Loading