fix(library): 资源行的存储后端列也改到目标实例
build / build (push) Successful in 1m17s

原版应用先按 resources.storage_backend_id 找文件服务;只改定位符不改这一列,
目标仍报 storage backend not found 并拒绝整条路径(真实下载 500 code1007)。
行变换同时改写该列,写入与校验共用。

试过:目标同步后 /api/v1/knowledge/{id}/download 500 → 修后复测读回 507B 且
sha256 与源对象一致;go test ./internal/releaseadapter/v071 与 make verify 全绿。
This commit is contained in:
姚章浩
2026-10-29 07:08:39 +08:00
parent 1aecd9d6af
commit c542a1333a
3 changed files with 38 additions and 1 deletions
+2 -1
View File
@@ -26,11 +26,12 @@
### Fixed
- **同步过去的资源行指向来源实例的存储后端 id**:`storage://<id>/minio://<bucket>/<key>`
- **同步过去的资源行指向来源实例的存储后端 id(定位符与独立列两处)**:`storage://<id>/minio://<bucket>/<key>`
里的 `<id>` 是来源 `storage_backends` 的主键,目标实例没有这条行。只换桶不改 id 时,
原版应用落回默认存储服务并拒绝整条路径(真实下载 500 `code 1007
invalid MinIO file path`)。现在写入前按"租户 + 目标桶名"在目标库解析后端 id,
写入与校验共用同一份行变换;解析不到就拒绝写入,不产出目标读不出来的定位符。
`resources.storage_backend_id` 这一列同样要换(应用先按它找文件服务)。
- 指纹对空白敏感会让"同一份内容"两边算不出同一个值(PostgreSQL `to_jsonb::text`
带空格、Go `json.Marshal` 不带);指纹改为先 `json.Compact` 再摘要。