feat(library): 维护窗口支持显式 no-gate 测试栈
build / build (push) Successful in 2m2s

0.9.0 测试栈没有入口闸门容器(只有 app/frontend/docreader/es/redis),
实例级维护窗口因此开不了。新增 LIBRARY_TARGET_INGRESS_MODE=none,
必须同时给 LIBRARY_NO_INGRESS_ACK=test-only 且不得声明半套闸门;
默认仍是 gate,行为与文案不变。

no-gate 下不调用任何闸门动作,改为要求 LIBRARY_TARGET_HEALTH_URL 并在
恢复后探测 200;维护记录、冻结日志与快照写入 ingress_mode/ingress_ack,
gate 证据位置如实写“无闸门(测试模式)”,不伪装“入口已排空”。
This commit is contained in:
姚章浩
2026-11-16 22:58:37 +08:00
parent 5f1a8f565c
commit 2066bedbbe
18 changed files with 1014 additions and 104 deletions
+8
View File
@@ -623,6 +623,11 @@ func openFreeze(ctx context.Context, opts options) (*libraryfreeze.Coordinator,
//
// 入口/队列的声明与容器内 worker 共用同一组 LIBRARY_TARGET_* 名称,
// 数据库/索引/桶则取自本次真实发现的源,避免"关的是 A 的门、读的是 B 的队列"。
//
// LIBRARY_TARGET_INGRESS_MODE=none 只给整栈没有闸门的测试环境(0.9.0 测试栈):
// 必须同时给 LIBRARY_NO_INGRESS_ACK=test-only,窗口里一笔闸门动作都不做,
// 排空证据降为"写者全停 + 队列静默",恢复由 LIBRARY_TARGET_HEALTH_URL 的 200 证明。
// 缺省仍是 gate:没有显式确认就照旧要求闸门。
func captureMaintenanceConfig(opts options, source sourceConfig, get func(string) string) (librarymaintenance.Config, error) {
target, err := librarymaintenance.TargetFromEnv(get)
if err != nil {
@@ -642,9 +647,12 @@ func captureMaintenanceConfig(opts options, source sourceConfig, get func(string
Writers: writers,
NonWriters: nonWriters,
DockerSocket: opts.dockerSocket,
IngressMode: target.Mode,
IngressAck: target.Ack,
IngressURL: target.IngressURL,
IngressService: target.IngressService,
IngressDrainFile: target.IngressDrainFile,
HealthURL: target.HealthURL,
Database: identity,
Index: source.SearchIndex,
Bucket: source.Object.Bucket,