You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Bugfix: Ensure can_copy_from failures fully roll back deployment creation (#6228)
* store: Reject incompatible graft schemas during site allocation
Signed-off-by: Maksim Dimitrov <dimitrov.maksim@gmail.com>
* store: Move recording the active_copy in the transaction
Signed-off-by: Maksim Dimitrov <dimitrov.maksim@gmail.com>
* fix(store): handle orphaned sites in graft compatibility check
Move graft compatibility validation out of primary transaction to avoid
holding primary and shard connections simultaneously, which could exhaust
connection pools when they share the same database.
- Detect orphaned sites (site exists but deployment doesn't) and re-run
the graft `can_copy_from` check on redeploy
- Only insert into `active_copies` when a copy is actually needed, avoiding
spurious records for already-copied deployments
- Maintain idempotency: failed deployments leave state that will be properly
validated on the next attempt
Signed-off-by: Maksim Dimitrov <dimitrov.maksim@gmail.com>
* store: Address comments and move evaluations until they are needed.
Move deployment exists check into the graft_base branch so the DB exists call is only executed when we actually are creating a graft.
Rename needs_check → should_validate and add a clear comment describing the validation cases.
Avoid calling layout unless validation is required and keep shard connections short‑lived (acquire/drop per use) to reduce connection deadlock risk.
Signed-off-by: Maksim Dimitrov <dimitrov.maksim@gmail.com>
---------
Signed-off-by: Maksim Dimitrov <dimitrov.maksim@gmail.com>
0 commit comments