hanahmily commented on code in PR #920:
URL:
https://github.com/apache/skywalking-banyandb/pull/920#discussion_r2663166311
##########
banyand/metadata/client.go:
##########
@@ -96,13 +115,54 @@ func (s *clientService) FlagSet() *run.FlagSet {
fs.StringVar(&s.etcdTLSKeyFile, flagEtcdTLSKeyFile, "", "Private key
for the etcd client certificate.")
fs.DurationVar(&s.registryTimeout, "node-registry-timeout",
2*time.Minute, "The timeout for the node registry")
fs.DurationVar(&s.etcdFullSyncInterval, "etcd-full-sync-interval",
30*time.Minute, "The interval for full sync etcd")
+
+ // node discovery configuration
+ fs.StringVar(&s.nodeDiscoveryMode, "node-discovery-mode",
NodeDiscoveryModeEtcd,
+ "Node discovery mode: 'etcd' for etcd-based discovery, 'dns'
for DNS-based discovery")
+ fs.StringSliceVar(&s.dnsSRVAddresses,
"node-discovery-dns-srv-addresses", []string{},
+ "DNS SRV addresses for node discovery (e.g.,
_grpc._tcp.banyandb.svc.cluster.local)")
+ fs.DurationVar(&s.dnsFetchInitInterval,
"node-discovery-dns-fetch-init-interval", 5*time.Second,
+ "DNS query interval during initialization phase")
+ fs.DurationVar(&s.dnsFetchInitDuration,
"node-discovery-dns-fetch-init-duration", 5*time.Minute,
+ "Duration of the initialization phase for DNS discovery")
+ fs.DurationVar(&s.dnsFetchInterval,
"node-discovery-dns-fetch-interval", 15*time.Second,
+ "DNS query interval after initialization phase")
+ fs.DurationVar(&s.grpcTimeout, "node-discovery-grpc-timeout",
5*time.Second,
+ "Timeout for gRPC calls to fetch node metadata")
+ fs.BoolVar(&s.dnsTLSEnabled, "node-discovery-dns-tls", false,
+ "Enable TLS for DNS discovery gRPC connections")
+ fs.StringSliceVar(&s.dnsCACertPaths, "node-discovery-dns-ca-certs",
[]string{},
+ "Comma-separated list of CA certificate files to verify DNS
discovered nodes (one per SRV address, in same order)")
+
return fs
}
func (s *clientService) Validate() error {
- if s.endpoints == nil {
- return errors.New("endpoints is empty")
+ if s.nodeDiscoveryMode != NodeDiscoveryModeEtcd && s.nodeDiscoveryMode
!= NodeDiscoveryModeDNS {
+ return fmt.Errorf("invalid node-discovery-mode: %s, must be
'%s' or '%s'", s.nodeDiscoveryMode, NodeDiscoveryModeEtcd, NodeDiscoveryModeDNS)
}
+
+ // Validate etcd endpoints (required when using etcd-based node
discovery for schema storage)
+ if s.nodeDiscoveryMode == NodeDiscoveryModeEtcd && len(s.endpoints) ==
0 {
Review Comment:
It's a bug, pls fix it.
--
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]