Skip to content

Commit ffd12aa

Browse files
committed
maybe the old test would work?
Signed-off-by: Alex Chi Z <chi@neon.tech>
1 parent 81d0f5d commit ffd12aa

File tree

3 files changed

+7
-17
lines changed

3 files changed

+7
-17
lines changed

compute_tools/src/compute.rs

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -146,7 +146,7 @@ pub struct ComputeNode {
146146
/// read/write, not the whole configuration process.
147147
pub state: Mutex<ComputeState>,
148148
/// `Condvar` to allow notifying waiters about state changes.
149-
pub state_changed: Condvar,
149+
pub state_changed: tokio::sync::Condvar,
150150

151151
// key: ext_archive_name, value: started download time, download_completed?
152152
pub ext_download_progress: RwLock<HashMap<String, (DateTime<Utc>, bool)>>,
@@ -2648,7 +2648,7 @@ LIMIT 100",
26482648
/// the pageserver connection strings has changed.
26492649
///
26502650
/// The operation will time out after a specified duration.
2651-
pub fn wait_timeout_while_pageserver_connstr_unchanged(&self, duration: Duration) {
2651+
pub async fn wait_timeout_while_pageserver_connstr_unchanged(&self, duration: Duration) {
26522652
let state = self.state.lock().unwrap();
26532653
let old_pageserver_conninfo = state
26542654
.pspec

compute_tools/src/lsn_lease.rs

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -62,7 +62,11 @@ async fn lsn_lease_bg_task(
6262
"Request succeeded, sleeping for {} seconds",
6363
sleep_duration.as_secs()
6464
);
65-
compute.wait_timeout_while_pageserver_connstr_unchanged(sleep_duration);
65+
let compute = compute.clone();
66+
tokio::task::spawn_blocking(|| {
67+
compute.wait_timeout_while_pageserver_connstr_unchanged(sleep_duration);
68+
})
69+
.await?;
6670
}
6771
}
6872

test_runner/regress/test_readonly_node.py

Lines changed: 0 additions & 14 deletions
Original file line numberDiff line numberDiff line change
@@ -233,15 +233,6 @@ def trigger_gc_and_select(
233233
log.info(f"`SELECT` query succeed after GC, {ctx=}")
234234
return offset
235235

236-
# It's not reliable to let the compute renew the lease in this test case as we have a very tight
237-
# lease timeout. Therefore, the test case itself will renew the lease.
238-
#
239-
# This is a workaround to make the test case more deterministic.
240-
def renew_lease(env: NeonEnv, lease_lsn: Lsn):
241-
env.storage_controller.pageserver_api().timeline_lsn_lease(
242-
env.initial_tenant, env.initial_timeline, lease_lsn
243-
)
244-
245236
# Insert some records on main branch
246237
with env.endpoints.create_start("main", config_lines=["shared_buffers=1MB"]) as ep_main:
247238
with ep_main.cursor() as cur:
@@ -254,9 +245,6 @@ def renew_lease(env: NeonEnv, lease_lsn: Lsn):
254245
XLOG_BLCKSZ = 8192
255246
lsn = Lsn((int(lsn) // XLOG_BLCKSZ) * XLOG_BLCKSZ)
256247

257-
# We need to mock the way cplane works: it gets a lease for a branch before starting the compute.
258-
renew_lease(env, lsn)
259-
260248
with env.endpoints.create_start(
261249
branch_name="main",
262250
endpoint_id="static",
@@ -277,8 +265,6 @@ def renew_lease(env: NeonEnv, lease_lsn: Lsn):
277265
ps.stop()
278266
ps.start()
279267

280-
renew_lease(env, lsn)
281-
282268
trigger_gc_and_select(
283269
env,
284270
ep_static,

0 commit comments

Comments
 (0)