fxbing commented on code in PR #4573:
URL: https://github.com/apache/flink-cdc/pull/4573#discussion_r4282961117
##########
flink-cdc-connect/flink-cdc-pipeline-connectors/flink-cdc-pipeline-connector-fluss/src/main/java/org/apache/flink/cdc/connectors/fluss/source/enumerator/FlussSourceEnumerator.java:
##########
@@ -293,6 +294,14 @@ private DiscoveryResult getSubscribedTableBuckets() throws
Exception {
*/
private void checkTableBucketChanges(DiscoveryResult discoveryResult,
Throwable error) {
if (error != null) {
+ if (scanDiscoveryIntervalMs > 0
Review Comment:
Thanks for the review @loserwang1024 ! We traced and reproduced the exact
scenario where read-only `FlussAdmin` calls still throw `NetworkException`
(`RetriableException`) after apache/fluss#3390:
1. **Server shutdown window (`RpcServer` stops before ZK unregistration)**:
In `TabletServer.closeAsync()`, the server runs controlled shutdown, closes
`RpcServer`, cleans up tablet/replica services, and closes `ZooKeeperClient`
last. Between `RpcServer` shutdown and ZK node removal, healthy `TabletServer`s
still return the shutting-down node as alive in `MetadataResponse`.
2. **Client refresh & stateless retry selection**: When
`listPartitionInfos()` first hits the shutting-down node (e.g., `ts-0`) and
fails, `MetadataUpdater.refreshClusterUntilAvailable()` fetches metadata from a
healthy node (e.g., `ts-2`). Because the response still contains `[ts-0, ts-1,
ts-2]`, `updateClusterMetadata()` clears `ts-0` from
`unavailableTabletServerIds`. The single retry in `RetryableGatewayClientProxy`
then calls `getRandomTabletServer()` again, which can still pick `ts-0` and
fail with `NetworkException`.
I agree we shouldn't do infinite retries in the CDC enumerator. A cleaner
approach is to handle this in `apache/fluss` client by decoupling metadata
membership from connection readiness and skipping disconnected nodes during
reconnect backoff, similar to Apache Kafka
([`NetworkClient.leastLoadedNode()`](https://github.com/apache/kafka/blob/0e7f9c73071799f02fa8c38ebe3513eba7b69c53/clients/src/main/java/org/apache/kafka/clients/NetworkClient.java#L834-L907),
[KIP-144](https://cwiki.apache.org/confluence/spaces/KAFKA/pages/69408222/KIP-144+Exponential+backoff+for+broker+reconnect+attempts)).
--
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]