ruanwenjun opened a new pull request, #18296:
URL: https://github.com/apache/dolphinscheduler/pull/18296

   ## Was this PR generated or assisted by AI?
   
   YES. The root-cause investigation, the fix, and the unit test were produced 
with AI assistance (Claude Code) and reviewed by me before submitting.
   
   ## Purpose of the pull request
   
   This pull request fixes #18292.
   
   When ephemeral nodes expire and are purged from the JDBC registry, the 
resulting `REMOVE` event was built **without** `eventData`. Downstream 
subscribers rely on it:
   
   - `AbstractClusterSubscribeListener#notify` calls 
`parseServerFromHeartbeat(event.getEventData())`; on `null` it logs `"Unknown 
cluster change event"` and returns **before** `onServerRemove(...)`.
   - `AbstractHAServer` compares `serverIdentify.equals(event.getEventData())`.
   
   So the removal is effectively missed: Master instances keep stale registry 
data in memory (e.g. `MasterSlotManager` referencing slots that no longer 
exist), and commands assigned to those slots are never fetched.
   
   The ZooKeeper and Etcd registries already populate `eventData` on `REMOVE` 
events — the JDBC registry was the only one dropping it. The deleted value is 
available (the `DELETE` change-event persists the full row and round-trips it 
through JSON); it simply was not threaded through to the event.
   
   ## Brief change log
   
   - `JdbcRegistryDataChangeListener#onJdbcRegistryDataDeleted` now takes 
`(String key, String value)`, symmetric with `onJdbcRegistryDataChanged` / 
`onJdbcRegistryDataAdded`.
   - `JdbcRegistryServer#onRegistryRowDeleted` passes `data.getDataValue()`.
   - `JdbcRegistryDataChangeListenerAdapter#onJdbcRegistryDataDeleted` injects 
the value into the `REMOVE` `Event` via `.eventData(value)`.
   
   ## Verify this pull request
   
   This change added tests and can be verified as follows:
   
   - Added `JdbcRegistryDataChangeListenerAdapterTest`, asserting the `REMOVE` 
event carries the deleted node value as `eventData`.
   - Verified red-green: removing the `.eventData(value)` line makes the test 
fail (`getEventData() expected <value> but was null`); with the fix it passes. 
`spotless:check` is clean.
   
   ## 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 contain an incompatible change (the modified interface 
is internal to the JDBC registry plugin), so no update to 
`docs/docs/en/guide/upgrade/incompatible.md` is required.
   


-- 
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]

Reply via email to