You are viewing a plain text version of this content. The canonical link for it is here.
Posted to notifications@shardingsphere.apache.org by "knightting (via GitHub)" <gi...@apache.org> on 2025/04/10 09:41:34 UTC

[I] Failed to register slave: too long 'report-host' [shardingsphere]

knightting opened a new issue, #35159:
URL: https://github.com/apache/shardingsphere/issues/35159

   ## Bug Report
   
   [shardingsphere-proxy-apache-shardingsphere-proxy-charts-58twgsm.log](https://github.com/user-attachments/files/19682211/shardingsphere-proxy-apache-shardingsphere-proxy-charts-58twgsm.log)
   
   **For English only**, other languages will not accept.
   SHOW MIGRATION STATUS output column error_message has the message:
   
   ```
   java.util.concurrent.CompletionException: java.lang.RuntimeException: Failed to register slave: too long 'report-host'
   	at java.base/java.util.concurrent.CompletableFuture.encodeThrowable(CompletableFuture.java:315)
   	at java.base/java.util.concurrent.CompletableFuture.completeThrowable(CompletableFuture.java:320)
   	at java.base/java.util.concurrent.CompletableFuture$AsyncRun.run(CompletableFuture.java:1807)
   	at java.base/java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1136)
   	at java.base/java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:635)
   	at java.base/java.lang.Thread.run(Thread.java:833)
   Caused by: java.lang.RuntimeException: Failed to register slave: too long 'report-host'
   	at org.apache.shardingsphere.data.pipeline.mysql.ingest.client.MySQLClient.waitExpectedResponse(MySQLClient.java:229)
   	at org.apache.shardingsphere.data.pipeline.mysql.ingest.client.MySQLClient.registerSlave(MySQLClient.java:174)
   	at org.apache.shardingsphere.data.pipeline.mysql.ingest.client.MySQLClient.subscribe(MySQLClient.java:156)
   	at org.apache.shardingsphere.data.pipeline.mysql.ingest.MySQLIncrementalDumper.runBlocking(MySQLIncrementalDumper.java:93)
   	at org.apache.shardingsphere.data.pipeline.api.executor.AbstractLifecycleExecutor.start(AbstractLifecycleExecutor.java:51)
   	at org.apache.shardingsphere.data.pipeline.api.executor.AbstractLifecycleExecutor.run(AbstractLifecycleExecutor.java:76)
   	at java.base/java.util.concurrent.CompletableFuture$AsyncRun.run(CompletableFuture.java:1804)
   	... 3 more
   
   ````
   
   Before report a bug, make sure you have:
   
   - Searched open and closed [GitHub issues](https://github.com/apache/shardingsphere/issues).
   - Read documentation: [ShardingSphere Doc](https://shardingsphere.apache.org/document/current/en/overview).
   
   Please pay attention on issues you submitted, because we maybe need more details. 
   If no response anymore and we cannot reproduce it on current information, we will **close it**.
   
   Please answer these questions before submitting your issue. Thanks!
   
   ### Which version of ShardingSphere did you use?
   5.2.1
   ### Which project did you use? ShardingSphere-JDBC or ShardingSphere-Proxy?
   ShardingSphere-Proxy
   ### Expected behavior
   migrate data incrementally
   ### Actual behavior
   no incremental data migrated
   ### Reason analyze (If you can)
   java.util.concurrent.CompletionException: java.lang.RuntimeException: Failed to register slave: too long 'report-host'
   since we deploy proxy in k8s, so the name of host is long
   ### Steps to reproduce the behavior, such as: SQL to execute, sharding rule configuration, when exception occur etc.
   1. use helm to deploy proxy cluster in k8s
   2. config migrate task
   ```sql
   show databases ;
   CREATE DATABASE db_proxy;
   use db_proxy;
   
   
   ADD RESOURCE ds0 (
       URL="jdbc:mysql://xx",
       USER="",
       PASSWORD="",
       PROPERTIES("minPoolSize"="1","maxPoolSize"="20","idleTimeout"="60000")
   );
   
   
   
   CREATE SHARDING TABLE RULE t_aigc_chat_info(
   RESOURCES(ds0),
   SHARDING_COLUMN=session_id,
   TYPE(NAME="hash_mod",PROPERTIES("sharding-count"="64")))
   );
   
   ADD MIGRATION SOURCE RESOURCE hobby_aigc_ds (
       URL="jdbc:mysql://xx",
       USER="",
       PASSWORD="",
       PROPERTIES("minPoolSize"="1","maxPoolSize"="20","idleTimeout"="60000")
   );
   
   MIGRATE TABLE hobby_aigc_ds.t_aigc_chat_info INTO t_aigc_chat_info;
   
   ```
   
   ### Example codes for reproduce this issue (such as a github link).
   


-- 
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: notifications-unsubscribe@shardingsphere.apache.org.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org


Re: [I] Failed to register slave: too long 'report-host' [shardingsphere]

Posted by "knightting (via GitHub)" <gi...@apache.org>.
knightting commented on issue #35159:
URL: https://github.com/apache/shardingsphere/issues/35159#issuecomment-2792265840

   shorten the pod name to bypass the problem


-- 
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: notifications-unsubscribe@shardingsphere.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org


Re: [I] Failed to register slave: too long 'report-host' [shardingsphere]

Posted by "github-actions[bot] (via GitHub)" <gi...@apache.org>.
github-actions[bot] commented on issue #35159:
URL: https://github.com/apache/shardingsphere/issues/35159#issuecomment-3530096026

   There hasn't been any activity on this issue recently, and in order to prioritize active issues, it will be marked as stale.


-- 
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: notifications-unsubscribe@shardingsphere.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org


Re: [I] Failed to register slave: too long 'report-host' [shardingsphere]

Posted by "sandynz (via GitHub)" <gi...@apache.org>.
sandynz commented on issue #35159:
URL: https://github.com/apache/shardingsphere/issues/35159#issuecomment-3421795907

   Hi @knightting , `too long 'report-host'` is the limitation of MySQL, your workaround is OK. And we have no other solution for now.


-- 
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: notifications-unsubscribe@shardingsphere.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org


Re: [I] Failed to register slave: too long 'report-host' [shardingsphere]

Posted by "terrymanu (via GitHub)" <gi...@apache.org>.
terrymanu commented on issue #35159:
URL: https://github.com/apache/shardingsphere/issues/35159#issuecomment-3495206047

   Based on the analysis of GitHub issue #35159, this is a limitation of the MySQL replication mechanism, not a bug in ShardingSphere itself.
   
     Root Cause
   
     1. MySQL hostname length limitation: MySQL has a length limit for the report-host parameter in master-slave replication (typically 60 characters)
     2. Kubernetes environment characteristics: Pod names deployed in Kubernetes are typically very long, such as:
       - shardingsphere-proxy-apache-shardingsphere-proxy-charts-58222lk
       - shardingsphere-proxy-apache-shardingsphere-proxy-charts-5885fzf
       - shardingsphere-proxy-apache-shardingsphere-proxy-charts-58twgsm
   
     Code Flow Analysis
   
     From MySQLBinlogClient.java:195-203, we can see the slave registration flow:
   
     private void registerSlave() {
         responseCallback = new DefaultPromise<>(eventLoopGroup.next());
         InetSocketAddress localAddress = (InetSocketAddress) channel.localAddress();
         MySQLComRegisterSlaveCommandPacket packet = new MySQLComRegisterSlaveCommandPacket(
                 connectInfo.getServerId(), localAddress.getHostName(), // hostname obtained here is too long
                 connectInfo.getUsername(), connectInfo.getPassword(), localAddress.getPort());
         resetSequenceID();
         channel.writeAndFlush(packet);
         waitExpectedResponse(MySQLOKPacket.class); // "too long 'report-host'" error thrown here
     }
   
     Problem Classification
   
     - This is not a ShardingSphere bug, but an inherent limitation of the MySQL replication protocol
     - The error originates from MySQL server-side validation of the report-host parameter length
     - Maintainer @sandynz has confirmed this is a MySQL limitation with no other solution for now
   
     Solution
   
     Recommended Approach: Shorten Pod Names
   
     Customize shorter Pod names in your Helm chart configuration:
   
     # values.yaml
     fullnameOverride: "ss-proxy"
   
     Or use:
   
     # values.yaml  
     nameOverride: "ss-proxy"
   
     You can also set a shorter hostname through environment variables:
   
     # values.yaml
     env:
       - name: MY_HOSTNAME
         value: "ss-proxy-0"
   
     If Problem Persists
   
     If the issue still exists after shortening Pod names, please provide the following information:
   
     1. Complete error logs: More detailed MySQL error information
     2. MySQL version information: Result of SELECT VERSION()
     3. Helm configuration: Current values.yaml configuration being used
     4. Actual Pod hostname: Output of kubectl exec <pod-name> -- hostname
   
     Conclusion
   
     This is a MySQL replication protocol limitation, not a ShardingSphere bug. Your solution of shortening Pod names is correct and follows ShardingSphere usage patterns. ShardingSphere acts as a MySQL replication client in
     this scenario and cannot bypass MySQL server-side limitations.
   
     Your workaround (shortening Pod names) is currently the best solution available.
   


-- 
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: notifications-unsubscribe@shardingsphere.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org


Re: [I] Failed to register slave: too long 'report-host' [shardingsphere]

Posted by "terrymanu (via GitHub)" <gi...@apache.org>.
terrymanu closed issue #35159: Failed to register slave: too long 'report-host'
URL: https://github.com/apache/shardingsphere/issues/35159


-- 
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: notifications-unsubscribe@shardingsphere.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org