From e3d27b2f68585121ff5a79902cfe68af448f33c3 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Arpad=20M=C3=BCller?= Date: Wed, 2 Apr 2025 20:36:50 +0200 Subject: [PATCH] Start safekeeper node IDs with 0 and forbid 0 from registering (#11419) Right now we start safekeeper node ids at 0. However, other code treats 0 as invalid (see #11407). We decided on latter. Therefore, make the register python tests register safekeepers starting at node id 1 instead of 0, and forbid safekeepers with id 0 from registering. Context: https://github.com/neondatabase/neon/pull/11407#discussion_r2024852328 --- storage_controller/src/http.rs | 6 ++++++ test_runner/fixtures/neon_fixtures.py | 2 ++ 2 files changed, 8 insertions(+) diff --git a/storage_controller/src/http.rs b/storage_controller/src/http.rs index 8ec8bccf2c..4035a15316 100644 --- a/storage_controller/src/http.rs +++ b/storage_controller/src/http.rs @@ -1416,6 +1416,12 @@ async fn handle_upsert_safekeeper(mut req: Request) -> Result { return res; diff --git a/test_runner/fixtures/neon_fixtures.py b/test_runner/fixtures/neon_fixtures.py index 34a841f59f..7931a0a7d0 100644 --- a/test_runner/fixtures/neon_fixtures.py +++ b/test_runner/fixtures/neon_fixtures.py @@ -1344,6 +1344,8 @@ class NeonEnv: and self.storage_controller_config.get("timelines_onto_safekeepers") is True ): for sk_id, sk in enumerate(self.safekeepers): + # 0 is an invalid safekeeper id + sk_id = sk_id + 1 body = { "id": sk_id, "created_at": "2023-10-25T09:11:25Z",