- SearchIdentity 增加 NoTenantField,按目标 profile 决定是否注入 tenant_id (写入、归属预检、恢复搬运三条路径) - 归属冲突与写集合不匹配写明具体字段,排查不用再猜 - 网关侧 acquire 冲突打印 plan/claim/owner 三项
This commit is contained in:
@@ -143,7 +143,10 @@ func (exporter *SearchExporter) bulkIndex(ctx context.Context, documents []libra
|
||||
if err := json.Unmarshal(document.Source, &source); err != nil {
|
||||
return errors.New("archived index document is not an object")
|
||||
}
|
||||
source["tenant_id"], _ = json.Marshal(identity.TenantID)
|
||||
// 0.9.0 的索引文档没有 tenant_id:补上去会让恢复后的文档与目标契约不一致。
|
||||
if !identity.NoTenantField {
|
||||
source["tenant_id"], _ = json.Marshal(identity.TenantID)
|
||||
}
|
||||
source["knowledge_base_id"], _ = json.Marshal(identity.KnowledgeBaseID)
|
||||
encoded, err := json.Marshal(source)
|
||||
if err != nil {
|
||||
|
||||
Reference in New Issue
Block a user