WXPNG opened a new pull request, #12755:
URL: https://github.com/apache/seatunnel/pull/12755

   ## Purpose
   
   Fix https://github.com/apache/seatunnel/issues/12734
   
   A SeaTunnel worker is a Hazelcast lite member and can never become the 
cluster master. When a worker starts before the master, connecting to the 
candidate master addresses fails and Hazelcast adds them to the temporary 
blacklist (`blacklist(address, false)`). Once blacklisted, 
`sendMasterQuestion()` skips them forever, and because a lite member cannot 
self-elect, the join loop deadlocked until `hazelcast.max.join.seconds` 
(default 300s) elapsed, ending with `Could not join cluster. Shutting down 
now!`.
   
   ## Approach
   
   A minimal, lite-member-only change in 
`LiteNodeDropOutTcpIpJoiner#joinViaPossibleMembers`:
   
   - Introduces no new user-facing configuration option.
   - Reuses the joiner's existing retry cadence (`JOIN_RETRY_WAIT_TIME`, 1 
second via `clusterService.blockOnJoin(...)`).
   - When a lite member reaches the state where all candidate addresses are 
blacklisted, it waits one retry interval and then clears only the temporary 
blacklist entries (`unblacklist` removes entries with value `false`); 
permanently blacklisted addresses are left untouched.
   - The non-lite-member path (self-elect as master when all addresses are 
blacklisted) is unchanged.
   
   ## Tests
   
   `LiteNodeDropOutTcpIpJoinerTest`:
   
   1. `workerStartedBeforeMasterShouldEventuallyJoin` - the worker starts first 
and is given 3s to fail and temporarily blacklist the master address, then the 
master is started; the worker joins within the 60s window and never becomes 
master.
   2. `workerWithoutMasterShouldTimeoutAndNeverBecomeMaster` - a worker with a 
never-brought-up target times out and never self-elects.
   3. `nonLiteMemberShouldAssumeMasterWhenAllAddressesBlacklisted` - the 
non-lite path is unchanged.
   
   `LiteNodeDropOutDiscoveryJoinerTest`:
   
   4. `discoveryJoinerInheritsTcpIpRetryFix` - asserts the inheritance 
relationship.
   5. `discoveryWorkerStartedBeforeMasterShouldEventuallyJoin` - a static 
discovery strategy returns the master address before the master port is ready, 
verifying the inherited retry.
   
   ## Scope note (discovery)
   
   The fix only helps when the initial discovery already returned the master 
address (temporarily unreachable). If the initial discovery returns an empty 
list and the master appears later, that is a separate "address refresh" 
scenario and is intentionally out of scope for this change.
   
   Close #12734
   


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