Uploaded image for project: 'Couchbase Server'
  1. Couchbase Server
  2. MB-36801

pools/default/nodeServices, pools/default is not use friendly with alternate-address

    XMLWordPrintable

Details

    • Bug
    • Resolution: Unresolved
    • Critical
    • backlog
    • 6.5.0
    • ns_server
    • None
    • Untriaged
    • Unknown

    Description

      Problem
      The output of alternateAddresses and nodesExt from /pools/default/nodeServices endpoint changes a lot depending on how alternate-address is set. This makes it tricky to cross refer node names to alternate-address (see MB-35235).

      1. Two node cluster with no alternate Address, notice how there is no information about the other node:

        {
            "clusterCapabilities": {
                "n1ql": [
                    "enhancedPreparedStatements"
                ]
            },
            "clusterCapabilitiesVer": [
                1,
                0
            ],
            "nodesExt": [
                {
                    "hostname": "172.18.1.197",
                    "services": {
                        "capi": 9500,
                        "capiSSL": 19500,
                        "indexAdmin": 9100,
                        "indexHttp": 9102,
                        "indexHttps": 19102,
                        "indexScan": 9101,
                        "indexStreamCatchup": 9104,
                        "indexStreamInit": 9103,
                        "indexStreamMaint": 9105,
                        "kv": 12000,
                        "kvSSL": 11998,
                        "mgmt": 9000,
                        "mgmtSSL": 19000,
                        "n1ql": 9499,
                        "n1qlSSL": 19499,
                        "projector": 10000
                    },
                    "thisNode": true
                },
                {
                    "services": {
                        "cbas": 9615,
                        "cbasSSL": 19601,
                        "eventingAdminPort": 9301,
                        "eventingDebug": 9307,
                        "eventingSSL": 19301,
                        "fts": 9202,
                        "ftsGRPC": 9203,
                        "ftsGRPCSSL": 19203,
                        "ftsSSL": 19202,
                        "mgmt": 9001,
                        "mgmtSSL": 19001
                    }
                }
            ],
            "rev": 106
        }
        

      2. With the alternate-address set on one node, notice the new section alternateAddresses and a number of default alternate ports:

        {
            "clusterCapabilities": {
                "n1ql": [
                    "enhancedPreparedStatements"
                ]
            },
            "clusterCapabilitiesVer": [
                1,
                0
            ],
            "nodesExt": [
                {
                    "alternateAddresses": {
                        "external": {
                            "hostname": "paddy1",
                            "ports": {
                                "capi": 9500,
                                "capiSSL": 19500,
                                "indexAdmin": 9100,
                                "indexHttp": 9102,
                                "indexHttps": 19102,
                                "indexScan": 9101,
                                "indexStreamCatchup": 9104,
                                "indexStreamInit": 9103,
                                "indexStreamMaint": 9105,
                                "kv": 12000,
                                "kvSSL": 11998,
                                "mgmt": 9000,
                                "mgmtSSL": 19000,
                                "n1ql": 9499,
                                "n1qlSSL": 19499,
                                "projector": 10000
                            }
                        }
                    },
                    "hostname": "172.18.1.197",
                    "services": {
                        "capi": 9500,
                        "capiSSL": 19500,
                        "indexAdmin": 9100,
                        "indexHttp": 9102,
                        "indexHttps": 19102,
                        "indexScan": 9101,
                        "indexStreamCatchup": 9104,
                        "indexStreamInit": 9103,
                        "indexStreamMaint": 9105,
                        "kv": 12000,
                        "kvSSL": 11998,
                        "mgmt": 9000,
                        "mgmtSSL": 19000,
                        "n1ql": 9499,
                        "n1qlSSL": 19499,
                        "projector": 10000
                    },
                    "thisNode": true
                },
                {
                    "services": {
                        "cbas": 9615,
                        "cbasSSL": 19601,
                        "eventingAdminPort": 9301,
                        "eventingDebug": 9307,
                        "eventingSSL": 19301,
                        "fts": 9202,
                        "ftsGRPC": 9203,
                        "ftsGRPCSSL": 19203,
                        "ftsSSL": 19202,
                        "mgmt": 9001,
                        "mgmtSSL": 19001
                    }
                }
            ],
            "rev": 107
        }
        

      3. One node with alternate hostname and Query Service port set. Now there is just one port in the list now:

        {
            "clusterCapabilities": {
                "n1ql": [
                    "enhancedPreparedStatements"
                ]
            },
            "clusterCapabilitiesVer": [
                1,
                0
            ],
            "nodesExt": [
                {
                    "alternateAddresses": {
                        "external": {
                            "hostname": "paddy1",
                            "ports": {
                                "n1ql": 10000
                            }
                        }
                    },
                    "hostname": "172.18.1.197",
                    "services": {
                        "capi": 9500,
                        "capiSSL": 19500,
                        "indexAdmin": 9100,
                        "indexHttp": 9102,
                        "indexHttps": 19102,
                        "indexScan": 9101,
                        "indexStreamCatchup": 9104,
                        "indexStreamInit": 9103,
                        "indexStreamMaint": 9105,
                        "kv": 12000,
                        "kvSSL": 11998,
                        "mgmt": 9000,
                        "mgmtSSL": 19000,
                        "n1ql": 9499,
                        "n1qlSSL": 19499,
                        "projector": 10000
                    },
                    "thisNode": true
                },
                {
                    "services": {
                        "cbas": 9615,
                        "cbasSSL": 19601,
                        "eventingAdminPort": 9301,
                        "eventingDebug": 9307,
                        "eventingSSL": 19301,
                        "fts": 9202,
                        "ftsGRPC": 9203,
                        "ftsGRPCSSL": 19203,
                        "ftsSSL": 19202,
                        "mgmt": 9001,
                        "mgmtSSL": 19001
                    }
                }
            ],
            "rev": 108
        }
        

      4. Now with one node with alternate address and port and a second node with just alternate address. Notice how the 2nd node does not have it's primary hostname/nodename:

        {
            "clusterCapabilities": {
                "n1ql": [
                    "enhancedPreparedStatements"
                ]
            },
            "clusterCapabilitiesVer": [
                1,
                0
            ],
            "nodesExt": [
                {
                    "alternateAddresses": {
                        "external": {
                            "hostname": "paddy1",
                            "ports": {
                                "n1ql": 10000
                            }
                        }
                    },
                    "hostname": "172.18.1.197",
                    "services": {
                        "capi": 9500,
                        "capiSSL": 19500,
                        "indexAdmin": 9100,
                        "indexHttp": 9102,
                        "indexHttps": 19102,
                        "indexScan": 9101,
                        "indexStreamCatchup": 9104,
                        "indexStreamInit": 9103,
                        "indexStreamMaint": 9105,
                        "kv": 12000,
                        "kvSSL": 11998,
                        "mgmt": 9000,
                        "mgmtSSL": 19000,
                        "n1ql": 9499,
                        "n1qlSSL": 19499,
                        "projector": 10000
                    },
                    "thisNode": true
                },
                {
                    "alternateAddresses": {
                        "external": {
                            "hostname": "paddy2",
                            "ports": {
                                "cbas": 9615,
                                "cbasSSL": 19601,
                                "eventingAdminPort": 9301,
                                "eventingDebug": 9307,
                                "eventingSSL": 19301,
                                "fts": 9202,
                                "ftsGRPC": 9203,
                                "ftsGRPCSSL": 19203,
                                "ftsSSL": 19202,
                                "mgmt": 9001,
                                "mgmtSSL": 19001
                            }
                        }
                    },
                    "services": {
                       "cbas": 9615,
                        "cbasSSL": 19601,
                        "eventingAdminPort": 9301,
                        "eventingDebug": 9307,
                        "eventingSSL": 19301,
                        "fts": 9202,
                        "ftsGRPC": 9203,
                        "ftsGRPCSSL": 19203,
                        "ftsSSL": 19202,
                        "mgmt": 9001,
                        "mgmtSSL": 19001
                    }
                }
            ],
            "rev": 109
        }
        

      Now if we do the same things from the pool/default

      1. Skipping the no alternate address set sample.
      2. With the alternate-address set on one node, notice how this port list is not the same as the pools/default/nodeServices

            "nodes": [
                {
                    "addressFamily": "inet",
                    "alternateAddresses": {
                        "external": {
                            "hostname": "paddy1",
                            "ports": {
                                "capi": 9500,
                                "capiSSL": 19500,
                                "kv": 12000,
                                "mgmt": 9000,
                                "mgmtSSL": 19000
                            }
                        }
                    },
        ...
                    "hostname": "172.18.1.197:9000",
        

      3. One node with alternate hostname and Query Service port set. Now there is no port section in the alternateAddresses section even though it's set:

            "nodes": [
                {
                    "addressFamily": "inet",
                    "alternateAddresses": {
                        "external": {
                            "hostname": "paddy1"
                        }
                    },
                    "clusterCompatibility": 393221,
        

      4. Skipping one node with alternate address and port and a second node with just alternate address output for pools/defaults


      Expectations
      For a simple API to show the current status of the alternate address config.

      Attachments

        Issue Links

          For Gerrit Dashboard: MB-36801
          # Subject Branch Project Status CR V

          Activity

            People

              Abhijeeth.Nuthan Abhijeeth Nuthan
              pvarley Patrick Varley (Inactive)
              Votes:
              0 Vote for this issue
              Watchers:
              2 Start watching this issue

              Dates

                Created:
                Updated:

                Gerrit Reviews

                  There are no open Gerrit changes

                  PagerDuty