Skip to content

Commit

Permalink
Service: set None observed state in re-attach
Browse files Browse the repository at this point in the history
  • Loading branch information
jcsp committed Mar 5, 2024
1 parent f720007 commit b41c637
Showing 1 changed file with 8 additions and 1 deletion.
9 changes: 8 additions & 1 deletion control_plane/attachment_service/src/service.rs
Original file line number Diff line number Diff line change
Expand Up @@ -945,7 +945,6 @@ impl Service {
id: tenant_shard_id,
gen: new_gen.into().unwrap(),
});

// Apply the new generation number to our in-memory state
let shard_state = locked.tenants.get_mut(&tenant_shard_id);
let Some(shard_state) = shard_state else {
Expand Down Expand Up @@ -981,6 +980,14 @@ impl Service {
if let Some(conf) = observed.conf.as_mut() {
conf.generation = new_gen.into();
}
} else {
// This node has no observed state for the shard: perhaps it was offline
// when the pageserver restarted. Insert a None, so that the Reconciler
// will be prompted to learn the location's state before it makes changes.
shard_state
.observed
.locations
.insert(reattach_req.node_id, ObservedStateLocation { conf: None });
}

// TODO: cancel/restart any running reconciliation for this tenant, it might be trying
Expand Down

0 comments on commit b41c637

Please sign in to comment.