Commit Graph

13 Commits

Author SHA1 Message Date
Jan Friesse
6f6c80f582 Qdevice: Send ring id in more messages
To prevent receiving vote from old membership ring id is sent to server
during init and replied back to client in every node list,
ask for vote reply and vote info messages.

Signed-off-by: Jan Friesse <jfriesse@redhat.com>
2016-06-28 13:58:43 +02:00
Jan Friesse
79a1b9ea59 Qnetd: Add advanced settings
All previously defined defaults are now configurable via -S option.

Signed-off-by: Jan Friesse <jfriesse@redhat.com>
2016-06-28 13:58:42 +02:00
Jan Friesse
25b50ed9f8 Qdevice: Allow compiler warn about unhandled case
Remove default case where switch selection is made on top of enum value.

Signed-off-by: Jan Friesse <jfriesse@redhat.com>
2016-06-28 13:58:41 +02:00
Jan Friesse
0c9df248f8 qdevice: Force send of heartbeat
Previously client was not force to use heartbeat. Because we have to be
able to detect dead client in qnetd, heartbeat setting is now forced.
Insted of set_option message, heartbeat is force to exists in init
message. This also means that
QDEVICE_NET_INSTANCE_STATE_WAITING_SET_OPTION_REPLY can be removed and
client is considered as connected after init_reply is received. So
currently, set_option is not used (but implementation of these two
messages still exists).

Signed-off-by: Jan Friesse <jfriesse@redhat.com>
2016-06-28 13:58:40 +02:00
Jan Friesse
6c1add2925 Improve qdevice
- Add support for cmap node list configuration change
- Add client side algorithms
- Check if currently received ring id in membership message
  equals to last sent ring id
- Send config node list only if config node list really changes and not
  after every reload
- Add tlv_ring_id_eq (replacing qnetd_algo_rings_eq) so it's usable in
  client
- Move debug logs from algo-test into qnetd-log-debug.c and call them in
  proper places (= logs are now algorithm independent)
- Fix memory leak in msg

Signed-off-by: Jan Friesse <jfriesse@redhat.com>
2016-06-28 13:58:39 +02:00
Jan Friesse
ee1e257b8d qdevice: Add tie_breaker option
Tie-breaker can be used in algorithm to decide if algorithm should
prefer highest, lowest or some concrete node id.

Signed-off-by: Jan Friesse <jfriesse@redhat.com>
2016-06-28 13:58:39 +02:00
Jan Friesse
8c0a45de41 qnet: Add TLV_VOTE_NO_CHANGE
State used for informative only callbacks (quorum node list) and
possibly informative only callbacks (configuration node list). Client
doesn't change cast vote timer state.

Signed-off-by: Jan Friesse <jfriesse@redhat.com>
2016-06-28 13:58:39 +02:00
Jan Friesse
afa22646f9 qnet: Migrate to new votequorum API
Signed-off-by: Jan Friesse <jfriesse@redhat.com>
2016-06-28 13:58:39 +02:00
Jan Friesse
b15497739e qnetd: Improvements
- Move adding client to cluster to init phase instead of preinit
- Implement missing ask for vote and vote info messages
- Fix cluster name memory leak
- Refactor unexpected message handler to one generic function
- Move qnetd_client_send_err to new file
- Add qnetd_client_send_vote_info

Signed-off-by: Jan Friesse <jfriesse@redhat.com>
2016-06-28 13:58:38 +02:00
Jan Friesse
d1d72dbc11 Qnetd improvements
- Complete config and membership node list callbacks
- Add client disconnect callback
- Always send msg_seq_num in node list
- Store config and last membership node list

Signed-off-by: Jan Friesse <jfriesse@redhat.com>
2016-06-28 13:58:38 +02:00
Jan Friesse
97ba4a077a Qnet improvements
- Support for membership node list
- Initial support for "pluggable" algorithms

Signed-off-by: Jan Friesse <jfriesse@redhat.com>
2016-06-28 13:58:38 +02:00
Jan Friesse
e221441b6c Qdevices-net improvements
- Implement node list
- Implement send buffer list
- Add nodelist message type
- Add ring_id, config_version, data_center_id, node_state, node_info,
  node_list_type and vote msg options

Signed-off-by: Jan Friesse <jfriesse@redhat.com>
2016-06-28 13:58:38 +02:00
Jan Friesse
908de5e36a Initial commit of qdevice net 2016-06-28 13:58:37 +02:00