Process Connection State Information

Registered by Megh Bhatt

The idea is to provide a single line description of the internal status of each process including connectivity information which can then be queried and displayed. The process's connectivity information refers to it's connections to various other servers and components. Each process updates a global connection info map implemented in base/connection_info.cc - libprocess_info for the various connections and then the library periodically sends over the connection info list and in addition also an overall process status as part of the process's node UVE.

The connection info map is keyed by a tuple <ConnectionType, std::string> where the ConnectionType is DISCOVERY, COLLECTOR, XMPP, etc. and the std::string is user specified.
For example, for discovery client code, the string can be the published or subscribed service name, for XMPP it can be the CN IP, etc.

The connection info map value consists of the ConnectionInfo of the particular entry, an optional string message describing relevant information about the status of the connection info, and an endpoint object representing the server.

A sample connection info map might be:

Key: <DISCOVERY:Collector-Service> Info: INIT, 10.84.13.23, "Subscribe"
Key:<DISCOVERY:XMPP-Service> Info: UP, 10.84.13.23, "Publish"
Key:<COLLECTOR:""> Info: UP, 10.84.13.23. ""
Key:<XMPP, 10.84.13.23> Info: UP, 10.84.13.23 "CN1"

Following are the .sandesh definitions:

struct ConnectionInfo {
    1: string type
    2: string name
    3: optional list<string> server_addrs
    4: string status
    5: optional string description
}

// Sent by the process
struct ProcessStatus {
    1: string module_id
    2: string instance_id
    3: string state
    4: optional list<ConnectionInfo> connection_infos
    5: optional string description
}

The library will periodically provide the existing connection info map to the process via a register callback function and the daemon code will update the overall process state, and an optional description. The library with then send both the connection info list and the state as part of the node UVE.

For vizd/collector, following is the sandesh IDL definition to send the connection info and status as part of the ObjectCollectorInfo. Similarly, other daemons will define the same for their node UVE.

struct NodeStatus {
    1: string name (key="ObjectCollectorInfo")
    2: optional bool deleted
    3: optional string status
    // Sent by process
    4: optional list<process_info.ProcessStatus> process_status (aggtype="union")
    // Sent by node manager
    5: optional list<process_info.ProcessInfo> process_info (aggtype="union")
    6: optional string description
}

uve sandesh NodeStatusUVE {
    1: NodeStatus data
}

Blueprint information

Status:
Complete
Approver:
Raj Reddy
Priority:
Undefined
Drafter:
Megh Bhatt
Direction:
Approved
Assignee:
Megh Bhatt
Definition:
Approved
Series goal:
None
Implementation:
Implemented
Milestone target:
None
Started by
Megh Bhatt
Completed by
Megh Bhatt

Related branches

Sprints

Whiteboard

(?)

Work Items

This blueprint contains Public information 
Everyone can see this information.