chore!: Bind real config address for Thrift and Raft services#16717
chore!: Bind real config address for Thrift and Raft services#16717CritasWang merged 3 commits intomasterfrom
Conversation
There was a problem hiding this comment.
Pull Request Overview
This PR modifies network binding behavior for Thrift services and Ratis consensus to properly handle the case where services should bind to all available network interfaces. The key changes ensure that when no specific bind address is provided, services use the proper InetSocketAddress constructor overload.
- Changes
ExternalRPCServiceto passnullinstead ofgetBindIP()for the bind address - Updates
AbstractThriftServiceThreadto properly handlenullbind addresses with conditional logic - Adds explicit host configuration for Ratis gRPC server
Reviewed Changes
Copilot reviewed 3 out of 3 changed files in this pull request and generated 1 comment.
| File | Description |
|---|---|
| AbstractThriftServiceThread.java | Added null-checks and conditional logic to properly handle binding to all interfaces when bindAddress is null |
| ExternalRPCService.java | Changed from passing getBindIP() to passing null to bind to all available network interfaces |
| RatisConsensus.java | Added explicit host configuration via GrpcConfigKeys.Server.setHost() |
Comments suppressed due to low confidence (1)
iotdb-core/datanode/src/main/java/org/apache/iotdb/db/service/ExternalRPCService.java:104
- The
getBindIP()method is now unused in this class after changing lines 74 and 87 to passnull. If this method is not part of an interface contract or used elsewhere, consider whether it still serves a purpose. If it's required by a parent class or interface, this is acceptable, but it creates potential confusion about why the method exists if it's not being used locally.
public String getBindIP() {
return config.getRpcAddress();
}
💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
iotdb-core/datanode/src/main/java/org/apache/iotdb/db/service/ExternalRPCService.java
Outdated
Show resolved
Hide resolved
Codecov Report❌ Patch coverage is
Additional details and impacted files@@ Coverage Diff @@
## master #16717 +/- ##
============================================
+ Coverage 38.72% 38.75% +0.02%
Complexity 207 207
============================================
Files 4986 5001 +15
Lines 330362 331347 +985
Branches 42000 42103 +103
============================================
+ Hits 127938 128408 +470
- Misses 202424 202939 +515 ☔ View full report in Codecov by Sentry. 🚀 New features to boost your workflow:
|
There was a problem hiding this comment.
Pull Request Overview
Copilot reviewed 3 out of 3 changed files in this pull request and generated no new comments.
Comments suppressed due to low confidence (1)
iotdb-core/datanode/src/main/java/org/apache/iotdb/db/service/ExternalRPCService.java:87
- Inconsistent bind address handling between SSL and non-SSL configurations. Line 74 passes
nullfor the SSL-enabled branch, but this line still passesgetBindIP()for the non-SSL branch. This creates different binding behavior depending on SSL configuration. For consistency with the SSL branch and the updatedAbstractThriftServiceThreadlogic, this should also be changed tonull.
getBindIP(),
💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
iotdb-core/datanode/src/main/java/org/apache/iotdb/db/service/ExternalRPCService.java
Outdated
Show resolved
Hide resolved
…ExternalRPCService.java Co-authored-by: Haonan <hhaonan@outlook.com>
|
* chore: Bind real internal address for Thrift and Raft services * keep ExternalRpcAddress use config value * Update iotdb-core/datanode/src/main/java/org/apache/iotdb/db/service/ExternalRPCService.java Co-authored-by: Haonan <hhaonan@outlook.com> --------- Co-authored-by: Haonan <hhaonan@outlook.com>
* chore: Bind real internal address for Thrift and Raft services * keep ExternalRpcAddress use config value * Update iotdb-core/datanode/src/main/java/org/apache/iotdb/db/service/ExternalRPCService.java Co-authored-by: Haonan <hhaonan@outlook.com> --------- Co-authored-by: Haonan <hhaonan@outlook.com> (cherry picked from commit 8dbf200)
* chore: Bind real internal address for Thrift and Raft services * keep ExternalRpcAddress use config value * Update iotdb-core/datanode/src/main/java/org/apache/iotdb/db/service/ExternalRPCService.java Co-authored-by: Haonan <hhaonan@outlook.com> --------- Co-authored-by: Haonan <hhaonan@outlook.com> (cherry picked from commit 8dbf200)



The listening addresses for Thrift and Raft services are now explicitly bound to a non-loopback interface. This may affect service discovery and communication between nodes in a cluster.
BREAKING CHANGE: The Thrift and Raft services now bind to the physical interface address (e.g., 192.168.1.100) instead of 0.0.0.0. Similarly, the ExternalRpc Address, which defaults to 0.0.0.0, will now bind to the explicitly configured IP address. Ensure your cluster configuration and firewall rules are updated to allow communication on the real internal network and the configured ExternalRpc address.