Skip to content

Commit

Permalink
Fix utilization URL and ensure heartbeats work (#10811)
Browse files Browse the repository at this point in the history
There was a typo in the name of the utilization endpoint URL, fix it.
Also, ensure that the heartbeat mechanism actually works.

Related: #10583, #10429

Part of #9011
  • Loading branch information
arpad-m authored Feb 13, 2025
1 parent 487f320 commit 5008324
Show file tree
Hide file tree
Showing 2 changed files with 13 additions and 4 deletions.
2 changes: 1 addition & 1 deletion safekeeper/src/http/routes.rs
Original file line number Diff line number Diff line change
Expand Up @@ -626,7 +626,7 @@ pub fn make_router(
failpoints_handler(r, cancel).await
})
})
.get("/v1/uzilization", |r| request_span(r, utilization_handler))
.get("/v1/utilization", |r| request_span(r, utilization_handler))
.delete("/v1/tenant/:tenant_id", |r| {
request_span(r, tenant_delete_handler)
})
Expand Down
15 changes: 12 additions & 3 deletions test_runner/regress/test_storage_controller.py
Original file line number Diff line number Diff line change
Expand Up @@ -3189,15 +3189,17 @@ def test_safekeeper_deployment_time_update(neon_env_builder: NeonEnvBuilder):

assert len(target.get_safekeepers()) == 0

sk_0 = env.safekeepers[0]

body = {
"active": True,
"id": fake_id,
"created_at": "2023-10-25T09:11:25Z",
"updated_at": "2024-08-28T11:32:43Z",
"region_id": "aws-us-east-2",
"host": "safekeeper-333.us-east-2.aws.neon.build",
"port": 6401,
"http_port": 7676,
"host": "localhost",
"port": sk_0.port.pg,
"http_port": sk_0.port.http,
"version": 5957,
"availability_zone_id": "us-east-2b",
}
Expand Down Expand Up @@ -3243,6 +3245,13 @@ def test_safekeeper_deployment_time_update(neon_env_builder: NeonEnvBuilder):
# Ensure idempotency
target.safekeeper_scheduling_policy(inserted["id"], "Decomissioned")

def storcon_heartbeat():
assert env.storage_controller.log_contains(
"Heartbeat round complete for 1 safekeepers, 0 offline"
)

wait_until(storcon_heartbeat)


def eq_safekeeper_records(a: dict[str, Any], b: dict[str, Any]) -> bool:
compared = [dict(a), dict(b)]
Expand Down

1 comment on commit 5008324

@github-actions
Copy link

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

7642 tests run: 7245 passed, 0 failed, 397 skipped (full report)


Flaky tests (2)

Postgres 17

Postgres 16

Code coverage* (full report)

  • functions: 33.0% (8594 of 26020 functions)
  • lines: 49.0% (72547 of 148029 lines)

* collected from Rust tests only


The comment gets automatically updated with the latest test results
5008324 at 2025-02-13T23:28:25.621Z :recycle:

Please sign in to comment.