src/center-ui/app/controllers/public_system_status_controller.rb
# Return the status information of the HA nodes.
Return the status information of the HA nodes.
Return the status information of the HA nodes .
def ha_node_status
    if !CommonSql.ha_configured?
      return { :ha_configured => false }
    end
    status_info = {
      :ha_configured => true, :nodes =>Hash.new,
    }
    all_nodes_ready = true
    configuration_ok = true
    all_nodes_ok = true
    replication_slot_count = 0
    node_status_result = ActiveRecord::Base.connection.execute(
      "select * from get_xroad_bdr_replication_info();")
    node_status_result.each do |node_info|
      node_ready, conf_ok, replication_active = format_node_status_info(
        status_info, node_info)
      if !node_ready
        all_nodes_ready = false
      end
      if !conf_ok
        configuration_ok = false
      end
      if replication_active
        replication_slot_count += 1
      end
    end
    status_info[:configuration_ok] = configuration_ok
    status_info[:all_nodes_ok] =
      replication_slot_count >= (node_status_result.length - 1) &&
      all_nodes_ready && configuration_ok
    return status_info
  end
def ha_node_status if ! CommonSql . ha_configured? return { :ha_configured => false } end status_info = { :ha_configured => true , :nodes => Hash . new , } all_nodes_ready = true configuration_ok = true all_nodes_ok = true replication_slot_count = 0 node_status_result = ActiveRecord :: Base . connection . execute ( "select * from get_xroad_bdr_replication_info();" ) node_status_result . each do | node_info | node_ready , conf_ok , replication_active = format_node_status_info ( status_info , node_info ) if ! node_ready all_nodes_ready = false end if ! conf_ok configuration_ok = false end if replication_active replication_slot_count += 1 end end status_info [ :configuration_ok ] = configuration_ok status_info [ :all_nodes_ok ] = replication_slot_count >= ( node_status_result . length - 1 ) && all_nodes_ready && configuration_ok return status_info end
Return the status information of the HA nodes.
Return the status information of the HA nodes .