Repository navigation
feat(storage): 增加文件内容校验与存储完整性巡检 - #60
Conversation
|
Important Review skippedToo many files! This PR contains 112 files, which is 12 over the limit of 100. To get a review, reduce the PR to 100 files or fewer by splitting it into smaller PRs or changing its base branch. Upgrade to a paid plan to raise the limit. This review couldn't start because sufficient usage credits or metered capacity aren't available. Add credits or update usage-based reviews in the billing tab, then retry. ⚙️ Run configurationConfiguration used: Repository UI Review profile: CHILL Plan: Advanced Run ID: ⛔ Files ignored due to path filters (1)
📒 Files selected for processing (112)
You can disable this status message by setting the Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out. Comment |
在移动工具栏接入工作区刷新状态,并让响应式 E2E 使用真实可见入口,修复 PR #60 的 CI 超时。
Issue
Closes #50
背景
现有存储对账只能发现对象缺失、孤立对象等问题,无法识别对象大小不变但内容已经损坏的情况。
本次改动为当前文件和历史版本增加独立的 SHA-256 完整性元数据,并提供异步巡检、渐进式回填、异常处理、管理后台及审计能力。
主要改动
文件完整性元数据
FileNode和FileVersion分别保存:pending,随后异步计算校验和。存储巡检任务
异常识别
巡检会结构化识别:
missing-object:存储对象不存在size-mismatch:对象实际大小与记录不符checksum-mismatch:对象内容 SHA-256 不一致verification-failed:对象读取或校验失败内容不匹配只会被标记、告警和记录审计,不会自动删除对象。未确认的异常历史版本也不会被版本清理任务删除。
本地存储与 S3/MinIO
GetObject内容计算校验和。管理后台
审计
新增以下关键操作与异常审计:
审计记录不会包含完整对象内容、原始哈希或未经处理的底层错误信息。
配套修复
数据库变更
新增迁移:
20260813120000_storage_object_integrity20260813123000_blob_integrity_tasks20260813124000_file_node_parent_integrity部署时需要执行数据库迁移。
已有文件不会在迁移后立即触发全量读取,可通过管理后台任务渐进式回填校验和。
验证结果
建议重点审查