Skip to content

Commit

Permalink
add local-proxy suffix to wake-compute requests, respect the returned…
Browse files Browse the repository at this point in the history
… port (#9298)

neondatabase/cloud#18349

Use the `-local-proxy` suffix to make sure we get the 10432 local_proxy
port back from cplane.
  • Loading branch information
conradludgate authored Oct 9, 2024
1 parent d346458 commit 306094a
Showing 1 changed file with 15 additions and 4 deletions.
19 changes: 15 additions & 4 deletions proxy/src/serverless/backend.rs
Original file line number Diff line number Diff line change
Expand Up @@ -28,7 +28,7 @@ use crate::{
retry::{CouldRetry, ShouldRetryWakeCompute},
},
rate_limiter::EndpointRateLimiter,
Host,
EndpointId, Host,
};

use super::{
Expand Down Expand Up @@ -222,7 +222,14 @@ impl PoolingBackend {
.auth_backend
.as_ref()
.map(|()| ComputeCredentials {
info: conn_info.user_info.clone(),
info: ComputeUserInfo {
user: conn_info.user_info.user.clone(),
endpoint: EndpointId::from(format!(
"{}-local-proxy",
conn_info.user_info.endpoint
)),
options: conn_info.user_info.options.clone(),
},
keys: crate::auth::backend::ComputeCredentialKeys::None,
});
crate::proxy::connect_compute::connect_to_compute(
Expand Down Expand Up @@ -507,8 +514,12 @@ impl ConnectMechanism for HyperMechanism {

let pause = ctx.latency_timer_pause(crate::metrics::Waiting::Compute);

// let port = node_info.config.get_ports().first().unwrap_or_else(10432);
let res = connect_http2(&host, 10432, timeout).await;
let port = *node_info.config.get_ports().first().ok_or_else(|| {
HttpConnError::WakeCompute(WakeComputeError::BadComputeAddress(
"local-proxy port missing on compute address".into(),
))
})?;
let res = connect_http2(&host, port, timeout).await;
drop(pause);
let (client, connection) = permit.release_result(res)?;

Expand Down

1 comment on commit 306094a

@github-actions
Copy link

Choose a reason for hiding this comment

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

5182 tests run: 4965 passed, 0 failed, 217 skipped (full report)


Flaky tests (2)

Postgres 17

Postgres 14

Code coverage* (full report)

  • functions: 31.4% (7546 of 24012 functions)
  • lines: 49.3% (60353 of 122535 lines)

* collected from Rust tests only


The comment gets automatically updated with the latest test results
306094a at 2024-10-09T23:36:32.252Z :recycle:

Please sign in to comment.