couchbaselabs / sdk-doctor

Application-server-side cluster connection diagnostics.
https://couchbase.com/
Apache License 2.0
18 stars 12 forks source link

sdk-doctor printout of config isn't the config actually used #33

Open ingenthr opened 1 week ago

ingenthr commented 1 week ago

When investigating a recent issue with private links, @brett19 was thrown off a bit because the output looked like this:

    "hostname": "svc-dqis-node-001.xs6ckb8g9gu9e4fg.cloud.couchbase.com:8091",
    "alternateAddresses": {
      "external": {
        "hostname": "private-endpoint.xs6ckb8g9gu9e4fg.cloud.couchbase.com",
        "ports": {
          "capiSSL": 18092,
          "mgmtSSL": 18091

    "hostname": "svc-dqis-node-002.xs6ckb8g9gu9e4fg.cloud.couchbase.com:8091",
    "alternateAddresses": {
      "external": {
        "hostname": "private-endpoint.xs6ckb8g9gu9e4fg.cloud.couchbase.com",
        "ports": {
          "capiSSL": 18092,
          "mgmtSSL": 18091

Note that it's missing the KV ports.

Later @brett19 realized they're not actually missing, but the sdk-doctor output doesn't align to the configuration sdk-doctor is actually using. Said Brett:

sdk-doctor fetches the config it actually uses via CCCP on private-endpoint.xs6ckb8g9gu9e4fg.cloud.couchbase.com:11207. Then the config it prints out actually comes from ns_server at https://private-endpoint.xs6ckb8g9gu9e4fg.cloud.couchbase.com:18091/pools/default/ . That ns_server endpoint doesn't include kv information.

We should update sdk-doctor to print the config it's actually using.

brett19 commented 1 week ago

It's worth mentioning that the "Terse" config that sdk-doctor actually uses to identify nodes has more information about things like alternate addresses, but contains significantly less details about the cluster. Rather than switching which config is printed, we should probably add the terse config we initially fetch to our logging so we get the best of both worlds (though also a bunch of log spam).