Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Add scheduling_policy column to safekeepers table #10205

Draft
wants to merge 2 commits into
base: main
Choose a base branch
from
Draft
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
1 change: 1 addition & 0 deletions libs/pageserver_api/src/controller_api.rs
Original file line number Diff line number Diff line change
Expand Up @@ -387,6 +387,7 @@ pub struct SafekeeperDescribeResponse {
pub port: i32,
pub http_port: i32,
pub availability_zone_id: String,
pub scheduling_policy: Option<String>,
}

#[cfg(test)]
Expand Down
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
ALTER TABLE safekeepers DROP scheduling_policy;
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
ALTER TABLE safekeepers ADD scheduling_policy VARCHAR;
2 changes: 2 additions & 0 deletions storage_controller/src/persistence.rs
Original file line number Diff line number Diff line change
Expand Up @@ -1227,6 +1227,7 @@ pub(crate) struct SafekeeperPersistence {
pub(crate) active: bool,
pub(crate) http_port: i32,
pub(crate) availability_zone_id: String,
pub(crate) scheduling_policy: Option<String>,
}

impl SafekeeperPersistence {
Expand All @@ -1252,6 +1253,7 @@ impl SafekeeperPersistence {
port: self.port,
http_port: self.http_port,
availability_zone_id: self.availability_zone_id.clone(),
scheduling_policy: self.scheduling_policy.clone(),
}
}
}
Expand Down
1 change: 1 addition & 0 deletions storage_controller/src/schema.rs
Original file line number Diff line number Diff line change
Expand Up @@ -39,6 +39,7 @@ diesel::table! {
active -> Bool,
http_port -> Int4,
availability_zone_id -> Text,
scheduling_policy -> Nullable<Varchar>,
}
}

Expand Down
2 changes: 1 addition & 1 deletion test_runner/regress/test_storage_controller.py
Original file line number Diff line number Diff line change
Expand Up @@ -3009,7 +3009,7 @@ def test_safekeeper_deployment_time_update(neon_env_builder: NeonEnvBuilder):
def eq_safekeeper_records(a: dict[str, Any], b: dict[str, Any]) -> bool:
compared = [dict(a), dict(b)]

masked_keys = ["created_at", "updated_at", "active"]
masked_keys = ["created_at", "updated_at", "active", "scheduling_policy"]

for d in compared:
# keep deleting these in case we are comparing the body as it will be uploaded by real scripts
Expand Down
Loading