mirror of
https://github.com/neondatabase/neon.git
synced 2026-05-17 13:10:38 +00:00
The list of endpoints was loaded by scanning the endpoints directory, whenever you started 'neon_local'. If you ran two 'neon_local endpoint create' commands concurrently, one of them might fail because of the other half-finished endpoint creation. There might be a directory without the endpoint.json file, for example, or a half-written endpoint.json file. Most commands don't need the full list of endpoints, however, so only load that when it's needed. In particular, it is now possible to run two "neon_local endpoint create" commands in parallel, if you explicitly assign a port to both. (If you let neon_local assign the port, it needs to check all the other endpoints to decide what ports are free.) Another race condition was with the branch-name mappings. They were previously stored in the 'config' file, which would also fail if two 'neon_local' commands tried to change it at the same time. To fix that race condition, use advisory file lock to coordinate access to the branch-name mappings, and only read/modify that file in commands that actually need the mappings. While at it, move the mappings to a separate 'branch_name_mappings.json' file. The motivation for these changes is that I wanted to create a python test that creates lots of tenants concurrently. Without these changes, the concurrent tenant creations would often hit these 'neon_local' race conditions and fail. 'neon_local' is still not concurrency-safe in general, but this is a good start.
35 lines
946 B
TOML
35 lines
946 B
TOML
[package]
|
|
name = "control_plane"
|
|
version = "0.1.0"
|
|
edition.workspace = true
|
|
license.workspace = true
|
|
|
|
[dependencies]
|
|
anyhow.workspace = true
|
|
clap.workspace = true
|
|
comfy-table.workspace = true
|
|
file-lock.workspace = true
|
|
git-version.workspace = true
|
|
nix.workspace = true
|
|
once_cell.workspace = true
|
|
postgres.workspace = true
|
|
regex.workspace = true
|
|
reqwest = { workspace = true, features = ["blocking", "json"] }
|
|
serde.workspace = true
|
|
serde_json.workspace = true
|
|
serde_with.workspace = true
|
|
tar.workspace = true
|
|
thiserror.workspace = true
|
|
toml.workspace = true
|
|
url.workspace = true
|
|
# Note: Do not directly depend on pageserver or safekeeper; use pageserver_api or safekeeper_api
|
|
# instead, so that recompile times are better.
|
|
pageserver_api.workspace = true
|
|
postgres_backend.workspace = true
|
|
safekeeper_api.workspace = true
|
|
postgres_connection.workspace = true
|
|
storage_broker.workspace = true
|
|
utils.workspace = true
|
|
|
|
workspace_hack.workspace = true
|