mirror of
https://github.com/neondatabase/neon.git
synced 2026-01-16 09:52:54 +00:00
## Problem In order to build AZ aware scheduling, the storage controller needs to know what AZ pageservers are in. Related https://github.com/neondatabase/neon/issues/8848 ## Summary of changes This patch set adds a new nullable column to the `nodes` table: `availability_zone_id`. The node registration request is extended to include the AZ id (pageservers already have this in their `metadata.json` file). If the node is already registered, then we update the persistent and in-memory state with the provided AZ. Otherwise, we add the node with the AZ to begin with. A couple assumptions are made here: 1. Pageserver AZ ids are stable 2. AZ ids do not change over time Once all pageservers have a configured AZ, we can remove the optionals in the code and make the database column not nullable.
48 lines
1.2 KiB
Rust
48 lines
1.2 KiB
Rust
// @generated automatically by Diesel CLI.
|
|
|
|
diesel::table! {
|
|
controllers (address, started_at) {
|
|
address -> Varchar,
|
|
started_at -> Timestamptz,
|
|
}
|
|
}
|
|
|
|
diesel::table! {
|
|
metadata_health (tenant_id, shard_number, shard_count) {
|
|
tenant_id -> Varchar,
|
|
shard_number -> Int4,
|
|
shard_count -> Int4,
|
|
healthy -> Bool,
|
|
last_scrubbed_at -> Timestamptz,
|
|
}
|
|
}
|
|
|
|
diesel::table! {
|
|
nodes (node_id) {
|
|
node_id -> Int8,
|
|
scheduling_policy -> Varchar,
|
|
listen_http_addr -> Varchar,
|
|
listen_http_port -> Int4,
|
|
listen_pg_addr -> Varchar,
|
|
listen_pg_port -> Int4,
|
|
availability_zone_id -> Nullable<Varchar>,
|
|
}
|
|
}
|
|
|
|
diesel::table! {
|
|
tenant_shards (tenant_id, shard_number, shard_count) {
|
|
tenant_id -> Varchar,
|
|
shard_number -> Int4,
|
|
shard_count -> Int4,
|
|
shard_stripe_size -> Int4,
|
|
generation -> Nullable<Int4>,
|
|
generation_pageserver -> Nullable<Int8>,
|
|
placement_policy -> Varchar,
|
|
splitting -> Int2,
|
|
config -> Text,
|
|
scheduling_policy -> Varchar,
|
|
}
|
|
}
|
|
|
|
diesel::allow_tables_to_appear_in_same_query!(controllers, metadata_health, nodes, tenant_shards,);
|