michaellx1057 opened a new pull request, #18641:
URL: https://github.com/apache/dolphinscheduler/pull/18641
## Was this PR generated or assisted by AI?
YES. Codex generated the initial Java patch and regression tests, assisted
with source analysis and this description, and ran the validation commands
reported below. The contributor requested the explicit `if/else` form during
review. AI review and automated test results do not replace maintainer
review.
是。Codex 生成了初始 Java 补丁和回归测试,协助源码分析与本文说明,
并执行了下方记录的验证命令。贡献者在审阅中要求使用明确的 `if/else`。
AI 复核和自动化测试结果不替代维护者审阅。
## Purpose of the pull request
Fixes #18640.
Etcd DELETE watch events carry the removed value in `prevKV`, but the
registry converter currently reads the empty current value. Cluster
subscribers can then ignore REMOVE and retain departed members.
This change restores the REMOVE event-data contract. It does not change
leader-election logic or claim to fix all duplicate workflow executions.
etcd DELETE 的旧值在 `prevKV` 中,但现有转换器读取当前空值,导致成员
监听器忽略 REMOVE。此修复恢复事件数据合同,不修改选主逻辑。
## Brief change log
- Use an explicit `if/else` to read DELETE event data from the previous KV.
- Continue deriving the event path from the current KV.
- Preserve ADD and UPDATE behavior.
- Add deterministic regression tests for these event semantics.
中文:DELETE 使用旧值,路径继续使用当前 key,保持 ADD/UPDATE 行为,
并增加确定性回归测试。
## Verify this pull request
Validated against dev commit
`9839c418c1a6d7f2a8c3395552edcd99c2de1b37` with Zulu JDK 8.
- Before the fix: 4 regression tests, with only DELETE previous-value
delivery
failing (expected `previous-heartbeat`, actual empty string).
- After the fix: all 4 regression tests passed.
- Final clean run: 18 tests passed, 0 failures, errors, or skipped tests:
4 event tests, 13 existing registry tests, and 1 lease-manager test.
- Spotless apply/check and `git diff --check` passed. The final clean reactor
run kept the default Spotless and JaCoCo checks enabled.
Reproduction command (JDK 8 and Docker required):
```bash
./mvnw -B -ntp \
-pl
dolphinscheduler-registry/dolphinscheduler-registry-plugins/dolphinscheduler-registry-etcd
\
-am clean test \
-Dtest=EtcdRegistryEventTest,EtcdRegistryTestCase,EtcdKeepAliveLeaseManagerTest
\
-Dsurefire.failIfNoSpecifiedTests=false
```
The local Apple Silicon run used the existing test image
`ibmcom/etcd:3.2.24` with `DOCKER_DEFAULT_PLATFORM=linux/amd64` and temporary
Maven Central mirror settings. No repository build configuration was changed.
中文:修复前 DELETE 旧值测试失败,其余 3 项通过;修复后全部通过。
最终 JDK 8 clean 构建共 18 项测试通过,无失败、错误或跳过;格式与差异检查通过。
验证范围为事件转换及既有 etcd 注册、锁和租约测试,未进行修复后的多 Master
端到端验收,也未部署到生产 3.4.2。
## Pull Request Notice
[Pull Request
Notice](https://github.com/apache/dolphinscheduler/blob/dev/docs/docs/en/contribute/join/pull-request.md)
This change does not modify the Registry public API, database schema,
dependencies, or configuration. It corrects the value delivered for etcd
REMOVE events.
本次不修改 Registry 公共 API、数据库结构、依赖或配置,仅纠正 etcd
REMOVE 事件携带的值。
--
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
To unsubscribe, e-mail: [email protected]
For queries about this service, please contact Infrastructure at:
[email protected]