Skip to content

Commit

Permalink
control_plane: fail consistency check if reconciles in progress
Browse files Browse the repository at this point in the history
  • Loading branch information
jcsp committed Mar 6, 2024
1 parent 5d1cb07 commit b78c2a6
Showing 1 changed file with 12 additions and 0 deletions.
12 changes: 12 additions & 0 deletions control_plane/attachment_service/src/service.rs
Original file line number Diff line number Diff line change
Expand Up @@ -2642,6 +2642,18 @@ impl Service {
.map(|t| t.to_persistent())
.collect::<Vec<_>>();

// This method can only validate the state of an idle system: if a reconcile is in
// progress, fail out early to avoid giving false errors on state that won't match
// between database and memory under a ReconcileResult is processed.
for t in locked.tenants.values() {
if t.reconciler.is_some() {
return Err(ApiError::InternalServerError(anyhow::anyhow!(
"Shard {} reconciliation in progress",
t.tenant_shard_id
)));
}
}

(expect_nodes, expect_shards)
};

Expand Down

0 comments on commit b78c2a6

Please sign in to comment.