Skip to content

Commit

Permalink
0dt: skip checking for DDL changes when told to skip catchup
Browse files Browse the repository at this point in the history
  • Loading branch information
aljoscha committed Feb 7, 2025
1 parent d019e11 commit f4ca720
Showing 1 changed file with 16 additions and 12 deletions.
28 changes: 16 additions & 12 deletions src/environmentd/src/deployment/preflight.rs
Original file line number Diff line number Diff line change
Expand Up @@ -189,14 +189,16 @@ pub async fn preflight_0dt(
check_ddl_changes_interval
.set_missed_tick_behavior(tokio::time::MissedTickBehavior::Skip);

let mut should_skip_catchup = false;
loop {
tokio::select! {
() = &mut caught_up_receiver => {
info!("deployment caught up");
break;
}
() = &mut skip_catchup => {
info!("skipping waiting for deployment to catch up due to administrator request");
should_skip_catchup = true;
break;
}
() = &mut caught_up_receiver => {
info!("deployment caught up");
break;
}
() = &mut caught_up_max_wait_fut => {
Expand Down Expand Up @@ -224,17 +226,19 @@ pub async fn preflight_0dt(

// Check for DDL changes one last time before announcing as ready to
// promote.
check_ddl_changes(
boot_ts,
persist_client.clone(),
environment_id.clone(),
deploy_generation,
Arc::clone(&catalog_metrics),
if !should_skip_catchup {
check_ddl_changes(
boot_ts,
persist_client.clone(),
environment_id.clone(),
deploy_generation,
Arc::clone(&catalog_metrics),
bootstrap_args.clone(),
initial_next_user_item_id,
initial_next_replica_id,
)
.await;
)
.await;
}

// Announce that we're ready to promote.
let promoted = deployment_state.set_ready_to_promote();
Expand Down

0 comments on commit f4ca720

Please sign in to comment.