mirror of
https://github.com/neondatabase/neon.git
synced 2025-12-22 21:59:59 +00:00
## Problem LKB-2502 The garbage collection of the project info cache is garbage. What we observed: If we get unlucky, we might throw away a very hot entry if the cache is full. The GC loop is dependent on getting a lucky shard of the projects2ep table that clears a lot of cold entries. The GC does not take into account active use, and the interval it runs at is too sparse to do any good. Can we switch to a proper cache implementation? Complications: 1. We need to invalidate by project/account. 2. We need to expire based on `retry_delay_ms`. ## Summary of changes 1. Replace `retry_delay_ms: Duration` with `retry_at: Instant` when deserializing. 2. Split the EndpointControls from the RoleControls into two different caches. 3. Introduce an expiry policy based on error retry info. 4. Introduce `moka` as a dependency, replacing our `TimedLru`. See the follow up PR for changing all TimedLru instances to use moka: #12726.
141 lines
4.5 KiB
TOML
141 lines
4.5 KiB
TOML
[package]
|
|
name = "proxy"
|
|
version = "0.1.0"
|
|
edition = "2024"
|
|
license.workspace = true
|
|
|
|
[features]
|
|
default = []
|
|
testing = ["dep:tokio-postgres"]
|
|
rest_broker = ["dep:subzero-core", "dep:ouroboros"]
|
|
|
|
[dependencies]
|
|
ahash.workspace = true
|
|
anyhow.workspace = true
|
|
arc-swap.workspace = true
|
|
async-compression.workspace = true
|
|
async-trait.workspace = true
|
|
atomic-take.workspace = true
|
|
aws-config.workspace = true
|
|
aws-credential-types.workspace = true
|
|
aws-sdk-iam.workspace = true
|
|
aws-sigv4.workspace = true
|
|
base64.workspace = true
|
|
bstr.workspace = true
|
|
bytes = { workspace = true, features = ["serde"] }
|
|
camino.workspace = true
|
|
chrono.workspace = true
|
|
clap = { workspace = true, features = ["derive", "env"] }
|
|
clashmap.workspace = true
|
|
compute_api.workspace = true
|
|
consumption_metrics.workspace = true
|
|
env_logger.workspace = true
|
|
framed-websockets.workspace = true
|
|
futures.workspace = true
|
|
hashbrown.workspace = true
|
|
hashlink.workspace = true
|
|
hex.workspace = true
|
|
hmac.workspace = true
|
|
hostname.workspace = true
|
|
http.workspace = true
|
|
http-utils.workspace = true
|
|
humantime.workspace = true
|
|
humantime-serde.workspace = true
|
|
hyper0.workspace = true
|
|
hyper = { workspace = true, features = ["server", "http1", "http2"] }
|
|
hyper-util = { version = "0.1", features = ["server", "http1", "http2", "tokio"] }
|
|
http-body-util = { version = "0.1" }
|
|
gettid = "0.1.3"
|
|
indexmap = { workspace = true, features = ["serde"] }
|
|
ipnet.workspace = true
|
|
itertools.workspace = true
|
|
itoa.workspace = true
|
|
json = { path = "../libs/proxy/json" }
|
|
lasso = { workspace = true, features = ["multi-threaded"] }
|
|
measured = { workspace = true, features = ["lasso"] }
|
|
metrics.workspace = true
|
|
moka.workspace = true
|
|
once_cell.workspace = true
|
|
opentelemetry = { workspace = true, features = ["trace"] }
|
|
papaya = "0.2.0"
|
|
parking_lot.workspace = true
|
|
parquet.workspace = true
|
|
parquet_derive.workspace = true
|
|
pin-project-lite.workspace = true
|
|
postgres_backend.workspace = true
|
|
postgres-client = { package = "tokio-postgres2", path = "../libs/proxy/tokio-postgres2" }
|
|
postgres-protocol = { package = "postgres-protocol2", path = "../libs/proxy/postgres-protocol2" }
|
|
pq_proto.workspace = true
|
|
rand.workspace = true
|
|
rand_core.workspace = true
|
|
regex.workspace = true
|
|
remote_storage = { version = "0.1", path = "../libs/remote_storage/" }
|
|
reqwest = { workspace = true, features = ["rustls-tls-native-roots"] }
|
|
reqwest-middleware = { workspace = true, features = ["json"] }
|
|
reqwest-retry.workspace = true
|
|
reqwest-tracing.workspace = true
|
|
rustc-hash.workspace = true
|
|
rustls.workspace = true
|
|
rustls-native-certs.workspace = true
|
|
rustls-pemfile.workspace = true
|
|
scopeguard.workspace = true
|
|
serde.workspace = true
|
|
serde_json.workspace = true
|
|
sha2 = { workspace = true, features = ["asm", "oid"] }
|
|
smol_str.workspace = true
|
|
smallvec.workspace = true
|
|
socket2.workspace = true
|
|
strum_macros.workspace = true
|
|
subtle.workspace = true
|
|
thiserror.workspace = true
|
|
tikv-jemallocator.workspace = true
|
|
tikv-jemalloc-ctl = { workspace = true, features = ["use_std"] }
|
|
tokio-postgres = { workspace = true, optional = true }
|
|
tokio-rustls.workspace = true
|
|
tokio-util.workspace = true
|
|
tokio = { workspace = true, features = ["signal"] }
|
|
tracing-subscriber.workspace = true
|
|
tracing-utils.workspace = true
|
|
tracing.workspace = true
|
|
tracing-log.workspace = true
|
|
tracing-opentelemetry.workspace = true
|
|
try-lock.workspace = true
|
|
typed-json.workspace = true
|
|
url.workspace = true
|
|
urlencoding.workspace = true
|
|
utils.workspace = true
|
|
uuid.workspace = true
|
|
x509-cert.workspace = true
|
|
redis.workspace = true
|
|
zerocopy.workspace = true
|
|
# uncomment this to use the real subzero-core crate
|
|
# subzero-core = { git = "https://github.com/neondatabase/subzero", rev = "396264617e78e8be428682f87469bb25429af88a", features = ["postgresql"], optional = true }
|
|
# this is a stub for the subzero-core crate
|
|
subzero-core = { path = "../libs/proxy/subzero_core", features = ["postgresql"], optional = true}
|
|
ouroboros = { version = "0.18", optional = true }
|
|
|
|
# jwt stuff
|
|
jose-jwa = "0.1.2"
|
|
jose-jwk = { version = "0.1.2", features = ["p256", "p384", "rsa"] }
|
|
signature = "2"
|
|
ecdsa = "0.16"
|
|
p256 = { version = "0.13", features = ["jwk"] }
|
|
ed25519-dalek = { version = "2", default-features = false, features = ["rand_core"] }
|
|
rsa = "0.9"
|
|
|
|
workspace_hack.workspace = true
|
|
|
|
[dev-dependencies]
|
|
assert-json-diff.workspace = true
|
|
camino-tempfile.workspace = true
|
|
fallible-iterator.workspace = true
|
|
flate2.workspace = true
|
|
tokio-tungstenite.workspace = true
|
|
pbkdf2 = { workspace = true, features = ["simple", "std"] }
|
|
rcgen.workspace = true
|
|
rstest.workspace = true
|
|
walkdir.workspace = true
|
|
rand_distr = "0.5"
|
|
tokio-postgres.workspace = true
|
|
tracing-test = "0.2"
|