temporal icon indicating copy to clipboard operation
temporal copied to clipboard

Surprising clusterMetadata override

Open wxing1292 opened this issue 3 years ago • 3 comments

Expected Behavior

If DB is not initialized, static config of cluster metadata should be

  • either respected & persisted into DB
  • or deprecated completely

Actual Behavior

clusterMetadata:
  enableGlobalNamespace: true
  failoverVersionIncrement: 10
  masterClusterName: "cluster-a"
  currentClusterName: "cluster-a"
  clusterInformation:
    cluster-a:
      enabled: true
      initialFailoverVersion: 3
      rpcName: "frontend"
      rpcAddress: "localhost:7233"
    cluster-b:
      enabled: true
      initialFailoverVersion: 2
      rpcName: "frontend"
      rpcAddress: "localhost:8233"

Using above static config & clean DB & after 1s ish, the cluster-b section will be deleted

Steps to Reproduce the Problem

See above

Specifications

  • Version: 1.16.x+
  • Platform: Mac & Intel

wxing1292 avatar Jul 14 '22 23:07 wxing1292

The add cluster from config is deprecated and a warning log will show if you figure it via config.

{"level":"warn","ts":"2022-07-15T14:38:43.425-0700","msg":"ClusterInformation in ClusterMetadata config is deprecated. Please use TCTL admin tool to configure remote cluster connections","component":"metadata-initializer","key":"clusterInformation","cluster-name":"standby","ignored-value":{"Enabled":true,"InitialFailoverVersion":2,"RPCAddress":"localhost:8233"},"logging-call-at":"fx.go:615"}

yux0 avatar Jul 15 '22 21:07 yux0

We cannot deprecate the clusterMetadata because we need to know the current cluster and load it from DB. I agree we can do better to refine this cluster metadata. But there will be questions about how to enable global namespace? How to deal with the primary cluster? How to set initialFailoverVersion and failoverVersionIncrement in first cluster initialization? How to be backward-compatible? Before solving those, the clusterMetadata will stay.

yux0 avatar Jul 15 '22 21:07 yux0

warn log says ClusterInformation is deprecated, but it did not say anything about ignoring cluster-b (non current cluster)

Silent failure is misleading, either complete deprecate the cluster metadata by using a new structure or improve the logging

wxing1292 avatar Jul 15 '22 23:07 wxing1292