-
Notifications
You must be signed in to change notification settings - Fork 6
[Enhancement]: 允许删除 setup 创建的首个存储策略和策略组 #565
Copy link
Copy link
Closed
Labels
EnhancementNew feature or requestNew feature or requestPriority: HighHigh priority issueHigh priority issueRustPull requests that update Rust codePull requests that update Rust codeScope: Admin UIAdministrator-facing frontend workflows and management interfacesAdministrator-facing frontend workflows and management interfacesScope: RuntimeRuntime lifecycle, async execution, tasks, and process-level performanceRuntime lifecycle, async execution, tasks, and process-level performanceScope: StorageStorage policies, connectors, drivers, provider capabilities, and storage backendsStorage policies, connectors, drivers, provider capabilities, and storage backendsTypeScriptPull requests that update JavaScript codePull requests that update JavaScript code
Description
Metadata
Metadata
Assignees
Labels
EnhancementNew feature or requestNew feature or requestPriority: HighHigh priority issueHigh priority issueRustPull requests that update Rust codePull requests that update Rust codeScope: Admin UIAdministrator-facing frontend workflows and management interfacesAdministrator-facing frontend workflows and management interfacesScope: RuntimeRuntime lifecycle, async execution, tasks, and process-level performanceRuntime lifecycle, async execution, tasks, and process-level performanceScope: StorageStorage policies, connectors, drivers, provider capabilities, and storage backendsStorage policies, connectors, drivers, provider capabilities, and storage backendsTypeScriptPull requests that update JavaScript codePull requests that update JavaScript code
Problem
AsterDrive 现在已经是平台化产品,首次 setup 也已经明确拆成
needs_admin -> needs_storage -> ready三步状态机。存储策略和策略组是管理员管理的普通拓扑对象,不应因为“这是初始化时创建的第一个对象”而永久不可删除。当前实现仍保留了早期单机 bootstrap 假设:
src/services/storage_policy/policy/policies.rs用固定的SYSTEM_STORAGE_POLICY_ID = 1永久拒绝删除内置系统存储策略;lock_default_group_assignment还把策略 ID1当作默认策略/策略组变更的数据库锁行;这会把“完成一次 setup”误读成“永久保留第一条策略”。对 Kubernetes 用户尤其不合适:常见部署会先通过 setup 创建一条临时或占位策略,随后切换到共享 PVC、S3 兼容对象存储或远程 follower。当前限制会留下清理路径被永久阻断的死配置,并让管理员误以为首条策略是系统内建资源,而不是可替换的部署拓扑。
相关背景:#444 正在重做策略组路由模型,本 issue 先把策略/策略组生命周期边界定清,避免新模型继续携带固定首条记录假设。
Desired behavior
needs_storage,而不是返回“删除唯一默认策略被拒绝”。重新创建并设为默认策略、完成默认策略组配置后,再回到ready。needs_storage,并在 setup 状态接口、管理端和 readiness 语义中保持一致。Implementation requirements
SYSTEM_STORAGE_POLICY_ID的永久删除保护;如果 ID1仍被迁移或兼容逻辑使用,必须与“是否可删除”解耦。1已删除后重新创建默认策略的并发场景。Acceptance criteria
/auth/check、setup state、readiness 和管理 UI 均反映needs_storage。ready;不依赖 ID1重新出现。1已删除后,并发创建/切换默认策略仍使用稳定锁正确串行化;SQLite、PostgreSQL、MySQL 的事务语义分别得到验证。force=true的现有行为回归测试保持通过。Non-goals
Category
Admin features
Contribution
Checklist