Commit Graph

36 Commits

Author SHA1 Message Date
Jan Friesse
41d6d1e438 Qdevice: 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
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
509d4b1511 qdevice: Ensure to exit if ipc socket is closed
When ipc socket was closed before poll and new connection got same fd as
original IPC socket, shutdown didn't work. Solution is to check if IPC
socket is active during poll array create.

Signed-off-by: Jan Friesse <jfriesse@redhat.com>
2016-06-28 13:58:42 +02:00
Jan Friesse
91b1f44e8f Qdevice: Add IPC clients
Signed-off-by: Jan Friesse <jfriesse@redhat.com>
2016-06-28 13:58:42 +02:00
Jan Friesse
a419f1685d Qnetd: Add local IPC
Basic commands shutdown and status are implemented.

Signed-off-by: Jan Friesse <jfriesse@redhat.com>
2016-06-28 13:58:42 +02:00
Jan Friesse
471767ff0a Qnetd: Don't fall if TLS is disabled
Signed-off-by: Jan Friesse <jfriesse@redhat.com>
2016-06-28 13:58:41 +02:00
Jan Friesse
40ca891974 qdevice: Improve socket based IPC
Signed-off-by: Jan Friesse <jfriesse@redhat.com>
2016-06-28 13:58:41 +02:00
Jan Friesse
9b887d6bad qnetd: Factorize qnetd-poll-array to generic unit
Signed-off-by: Jan Friesse <jfriesse@redhat.com>
2016-06-28 13:58:41 +02:00
Jan Friesse
ea7611a9dd qdevice: Add support for daemonize
Also local unix socket is now created. In future this is going to be
used for qdevice-tool, for now it's used only for handling SIGINT and
SIGTERM.

Signed-off-by: Jan Friesse <jfriesse@redhat.com>
2016-06-28 13:58:40 +02:00
Jan Friesse
4231ad97a3 qnetd: Replace err by qnetd_log on some places
err should be used only before qnetd log is fully initialized.

Signed-off-by: Jan Friesse <jfriesse@redhat.com>
2016-06-28 13:58:40 +02:00
Jan Friesse
04ac73018e qnetd: Add support for qnetd algo timer
Algo timer is simplified timer designed for qnetd algorithm. Instead of
full timer only one can exists per client. Workflow is:
- In one of algorithm callbacks qnetd_client_algo_timer_schedule is
  called
- On timeout .timer_callback is called (for example
  qnetd_algo_test_timer_callback). It's possible to set send_vote and
  result_vote to send vote info to client
- It's possible to discard timer by calling
  qnetd_client_algo_timer_abort

Timer is automatically deleted on client disconnect.

To make all this possible, qnetd main loop now has support for
timer-list (main_timer_list). To be able to handle error and disconnect
client from timer callback, client has schedule_disconnect. If this is
set to 1, client is disconnected on current call of poll loop.

Signed-off-by: Jan Friesse <jfriesse@redhat.com>
2016-06-28 13:58:40 +02:00
Jan Friesse
d89c57ee89 qnetd: Return lock file fd
Signed-off-by: Jan Friesse <jfriesse@redhat.com>
2016-06-28 13:58:40 +02:00
Jan Friesse
131cfbe4ae Refactor qdevice-net
- corosync-device-net as binary is gone. Replacement is
  corosync-qdevice
- corosync-qdevice has support for multiple models (only net is
  currently implemented)
- Completelly redesign qdevice-net main loop.
  - Connect is non blocking
  - Cmap and Votequorum events are handled even before connect to
    qnetd. Algorithm gets send_node_list and vote set so it's not needed
    to check connection status and also vote_timer is running and voting
    until something changes (configuration or votequorum node list)
  - If connect fails, algorithm_disconnected with new reason
    CANT_CONNECT_TO_THE_SERVER is called
- Logging for qdevice is based on libqb logging functions. Also
  logging configuration from corosync.conf is now used and dynamic
  changes of configuration are handled.
- Added qdevice_net_algorithm_config_node_list_changed
- Changed qdevice_net_algorithm_votequorum_node_list_notify in respect
  of adding  send_node_list so it's similar to other functions.

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
2960122481 qnetd: Make proper support for ipv4/6
- Add option for forcing ip version 4 or 6
- Choose new default port. It's now 5403. Exactly one less than used by
  corosync.
- Fix compiler warning

Signed-off-by: Jan Friesse <jfriesse@redhat.com>
2016-06-28 13:58:39 +02:00
Jan Friesse
1561dce437 qnetd: Add init script
Signed-off-by: Jan Friesse <jfriesse@redhat.com>
2016-06-28 13:58:39 +02:00
Jan Friesse
ba1b4e91b4 qnetd: Refactor
Signed-off-by: Jan Friesse <jfriesse@redhat.com>
2016-06-28 13:58:39 +02:00
Jan Friesse
f7ca447799 qnetd: Really daemonize
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
21911d3906 qnetd: Some small improvements
Signed-off-by: Jan Friesse <jfriesse@redhat.com>
2016-06-28 13:58:39 +02:00
Jan Friesse
bdce67516f qnetd: Improve logging
Signed-off-by: Jan Friesse <jfriesse@redhat.com>
2016-06-28 13:58:38 +02:00
Christine Caulfield
cd3a96f26a qnetd: Add LMS algorithm
Only lightly tested so far

Signed-off-by: Christine Caulfield <ccaulfie@redhat.com>
2016-06-28 13:58:38 +02:00
Jan Friesse
02eafebdf5 Improve qdevice-net
- Add cast vote timer (qdevice-net now really votes)
- In sync phase it's impossible retreive cmap config version so it's no
  longer sent in membership node list
- Refactor qdevice-net

Signed-off-by: Jan Friesse <jfriesse@redhat.com>
2016-06-28 13:58:38 +02:00
Christine Caulfield
379a3a9b89 qdevice-net: add a 2node Last Man Standing algorithm
Signed-off-by: Christine Caulfield <ccaulfie@redhat.com>
2016-06-28 13:58:38 +02:00
Christine Caulfield
3999cd1444 qnetd: Move algorithms_register into qnetd-algorithms.c
and fix qnetd_algorithm_vote_info_reply_received

Signed-off-by: Christine Caulfield <ccaulfie@redhat.com>
2016-06-28 13:58:38 +02:00
Jan Friesse
81c1649191 corosync-qnetd-certutl: Improvements
- Location of certificates is now correctly set depending on operation
  (qnetd/node)
- Added quick start mode

Signed-off-by: Jan Friesse <jfriesse@redhat.com>
2016-06-28 13:58:38 +02:00
Christine Caulfield
b1504098f4 qnetd: Make it easier to add algorithms
Put the algorithms into an array of structure pointers
(a bit like corosync services) so we can easily add more
without having huge switch statements.

I haven't added any code to the client end that parses the
name into the enum. Yet.

Signed-off-by: Christine Caulfield <ccaulfie@redhat.com>
2016-06-28 13:58:38 +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
1365455250 qnetd: Add skel of ffsplit algo and cluster list
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
3a5cb94906 Improve qnet 2016-06-28 13:58:38 +02:00
Jan Friesse
908de5e36a Initial commit of qdevice net 2016-06-28 13:58:37 +02:00