mirror of
https://github.com/neondatabase/neon.git
synced 2026-05-20 14:40:37 +00:00
storcon: provide an az id in metadata.json from neon local (#8897)
## Problem Neon local set-up does not inject an az id in `metadata.json`. See real change in https://github.com/neondatabase/neon/pull/8852. ## Summary of changes We piggyback on the existing `availability_zone` pageserver configuration in order to avoid making neon local even more complex.
This commit is contained in:
@@ -1164,6 +1164,8 @@ class NeonEnv:
|
||||
"listen_http_addr": f"localhost:{pageserver_port.http}",
|
||||
"pg_auth_type": pg_auth_type,
|
||||
"http_auth_type": http_auth_type,
|
||||
# Default which can be overriden with `NeonEnvBuilder.pageserver_config_override`
|
||||
"availability_zone": "us-east-2a",
|
||||
}
|
||||
if self.pageserver_virtual_file_io_engine is not None:
|
||||
ps_cfg["virtual_file_io_engine"] = self.pageserver_virtual_file_io_engine
|
||||
@@ -1192,11 +1194,7 @@ class NeonEnv:
|
||||
|
||||
# Create a corresponding NeonPageserver object
|
||||
self.pageservers.append(
|
||||
NeonPageserver(
|
||||
self,
|
||||
ps_id,
|
||||
port=pageserver_port,
|
||||
)
|
||||
NeonPageserver(self, ps_id, port=pageserver_port, az_id=ps_cfg["availability_zone"])
|
||||
)
|
||||
cfg["pageservers"].append(ps_cfg)
|
||||
|
||||
@@ -2400,6 +2398,7 @@ class NeonStorageController(MetricsGetter, LogUtils):
|
||||
"listen_http_port": node.service_port.http,
|
||||
"listen_pg_addr": "localhost",
|
||||
"listen_pg_port": node.service_port.pg,
|
||||
"availability_zone_id": node.az_id,
|
||||
}
|
||||
log.info(f"node_register({body})")
|
||||
self.request(
|
||||
@@ -2923,10 +2922,11 @@ class NeonPageserver(PgProtocol, LogUtils):
|
||||
|
||||
TEMP_FILE_SUFFIX = "___temp"
|
||||
|
||||
def __init__(self, env: NeonEnv, id: int, port: PageserverPort):
|
||||
def __init__(self, env: NeonEnv, id: int, port: PageserverPort, az_id: str):
|
||||
super().__init__(host="localhost", port=port.pg, user="cloud_admin")
|
||||
self.env = env
|
||||
self.id = id
|
||||
self.az_id = az_id
|
||||
self.running = False
|
||||
self.service_port = port
|
||||
self.version = env.get_binary_version("pageserver")
|
||||
|
||||
@@ -109,9 +109,6 @@ DEFAULT_STORAGE_CONTROLLER_ALLOWED_ERRORS = [
|
||||
# controller's attempts to notify the endpoint).
|
||||
".*reconciler.*neon_local notification hook failed.*",
|
||||
".*reconciler.*neon_local error.*",
|
||||
# Neon local does not provide pageserver with an AZ
|
||||
# TODO: remove this once neon local does so
|
||||
".*registering without specific availability zone id.*",
|
||||
]
|
||||
|
||||
|
||||
|
||||
Reference in New Issue
Block a user