]> git.proxmox.com Git - mirror_corosync.git/log
mirror_corosync.git
8 years agoqdevice: Ensure to exit if ipc socket is closed
Jan Friesse [Tue, 31 May 2016 07:44:28 +0000 (09:44 +0200)]
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>
8 years agoQdevice: Add IPC clients
Jan Friesse [Wed, 25 May 2016 15:19:03 +0000 (17:19 +0200)]
Qdevice: Add IPC clients

Signed-off-by: Jan Friesse <jfriesse@redhat.com>
8 years agoqnetd: Add support for IPC list command
Jan Friesse [Tue, 17 May 2016 15:22:10 +0000 (17:22 +0200)]
qnetd: Add support for IPC list command

Signed-off-by: Jan Friesse <jfriesse@redhat.com>
8 years agoqdevice: Make sure qdevice exists on corosync exit
Jan Friesse [Thu, 5 May 2016 14:45:20 +0000 (16:45 +0200)]
qdevice: Make sure qdevice exists on corosync exit

Signed-off-by: Jan Friesse <jfriesse@redhat.com>
8 years agoAdd qdevice into spec file
Jan Friesse [Wed, 4 May 2016 16:50:10 +0000 (18:50 +0200)]
Add qdevice into spec file

Signed-off-by: Jan Friesse <jfriesse@redhat.com>
8 years agoMake sure all qdevice files are packaged
Jan Friesse [Wed, 4 May 2016 16:49:50 +0000 (18:49 +0200)]
Make sure all qdevice files are packaged

Signed-off-by: Jan Friesse <jfriesse@redhat.com>
8 years agoSplit qnetd certutil to qnetd and qdevice-net part
Jan Friesse [Wed, 4 May 2016 15:33:21 +0000 (17:33 +0200)]
Split qnetd certutil to qnetd and qdevice-net part

Signed-off-by: Jan Friesse <jfriesse@redhat.com>
8 years agoQnetd: Add local IPC
Jan Friesse [Wed, 4 May 2016 14:41:20 +0000 (16:41 +0200)]
Qnetd: Add local IPC

Basic commands shutdown and status are implemented.

Signed-off-by: Jan Friesse <jfriesse@redhat.com>
8 years agoQdevice: Quote str func compatible with simple_lex
Jan Friesse [Wed, 20 Apr 2016 14:19:46 +0000 (16:19 +0200)]
Qdevice: Quote str func compatible with simple_lex

Signed-off-by: Jan Friesse <jfriesse@redhat.com>
8 years agoQdevice: Improve simple lex and add unit test
Jan Friesse [Wed, 20 Apr 2016 10:32:46 +0000 (12:32 +0200)]
Qdevice: Improve simple lex and add unit test

Simple lex now support backslashes and quotes. Behavior is
similar to shell.

Signed-off-by: Jan Friesse <jfriesse@redhat.com>
8 years agoQdevice: Support for IPC status cmd in net model
Jan Friesse [Thu, 14 Apr 2016 16:21:35 +0000 (18:21 +0200)]
Qdevice: Support for IPC status cmd in net model

Signed-off-by: Jan Friesse <jfriesse@redhat.com>
8 years agoqdevice certutil: Increase default cert validity
Jan Friesse [Thu, 14 Apr 2016 16:18:05 +0000 (18:18 +0200)]
qdevice certutil: Increase default cert validity

Signed-off-by: Jan Friesse <jfriesse@redhat.com>
8 years agoQnetd: Don't fall if TLS is disabled
Jan Friesse [Thu, 14 Apr 2016 16:17:00 +0000 (18:17 +0200)]
Qnetd: Don't fall if TLS is disabled

Signed-off-by: Jan Friesse <jfriesse@redhat.com>
8 years agoQnetd: Log client in IP address:port format
Jan Friesse [Tue, 12 Apr 2016 15:14:06 +0000 (17:14 +0200)]
Qnetd: Log client in IP address:port format

Signed-off-by: Jan Friesse <jfriesse@redhat.com>
8 years agoQdevice: Don't abrt if IPC connect isn't accepted
Jan Friesse [Mon, 11 Apr 2016 15:29:10 +0000 (17:29 +0200)]
Qdevice: Don't abrt if IPC connect isn't accepted

Also sending buffer is increased from testing value 2 to 1024.

Signed-off-by: Jan Friesse <jfriesse@redhat.com>
8 years agoQdevice: Implement status command
Jan Friesse [Mon, 11 Apr 2016 14:53:04 +0000 (16:53 +0200)]
Qdevice: Implement status command

Signed-off-by: Jan Friesse <jfriesse@redhat.com>
8 years agoQdevice: Allow compiler warn about unhandled case
Jan Friesse [Mon, 11 Apr 2016 12:49:58 +0000 (14:49 +0200)]
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>
8 years agoQdevice: Add format macro for nodeid, ring, ...
Jan Friesse [Mon, 11 Apr 2016 11:26:02 +0000 (13:26 +0200)]
Qdevice: Add format macro for nodeid, ring, ...

Signed-off-by: Jan Friesse <jfriesse@redhat.com>
8 years agoqdevice: Properly free IPC data on exit
Jan Friesse [Fri, 8 Apr 2016 16:04:56 +0000 (18:04 +0200)]
qdevice: Properly free IPC data on exit

Signed-off-by: Jan Friesse <jfriesse@redhat.com>
8 years agoqdevice: Implement shutdown command
Jan Friesse [Fri, 8 Apr 2016 15:23:32 +0000 (17:23 +0200)]
qdevice: Implement shutdown command

Signed-off-by: Jan Friesse <jfriesse@redhat.com>
8 years agoqdevice: Add dynar prepend
Jan Friesse [Fri, 8 Apr 2016 15:05:27 +0000 (17:05 +0200)]
qdevice: Add dynar prepend

Signed-off-by: Jan Friesse <jfriesse@redhat.com>
8 years agoqdevice: Sending error (output) in IPC
Jan Friesse [Tue, 5 Apr 2016 16:34:59 +0000 (18:34 +0200)]
qdevice: Sending error (output) in IPC

Signed-off-by: Jan Friesse <jfriesse@redhat.com>
8 years agoqnetd: Fix logging function va_arg handling
Jan Friesse [Tue, 5 Apr 2016 16:33:15 +0000 (18:33 +0200)]
qnetd: Fix logging function va_arg handling

Signed-off-by: Jan Friesse <jfriesse@redhat.com>
8 years agoqdevice: Add vcatf to dynar-str
Jan Friesse [Tue, 5 Apr 2016 16:30:09 +0000 (18:30 +0200)]
qdevice: Add vcatf to dynar-str

Signed-off-by: Jan Friesse <jfriesse@redhat.com>
8 years agoqdevice: Fix cluster-list test
Jan Friesse [Tue, 5 Apr 2016 16:01:56 +0000 (18:01 +0200)]
qdevice: Fix cluster-list test

Signed-off-by: Jan Friesse <jfriesse@redhat.com>
8 years agoqdevice: Add functions to manipulate dynar string
Jan Friesse [Tue, 5 Apr 2016 16:00:52 +0000 (18:00 +0200)]
qdevice: Add functions to manipulate dynar string

Signed-off-by: Jan Friesse <jfriesse@redhat.com>
8 years agoqdevice: Add public prealloc function to dynar
Jan Friesse [Tue, 5 Apr 2016 15:59:51 +0000 (17:59 +0200)]
qdevice: Add public prealloc function to dynar

Signed-off-by: Jan Friesse <jfriesse@redhat.com>
8 years agoqdevice: Make simple-lex locale independent
Jan Friesse [Tue, 5 Apr 2016 15:58:06 +0000 (17:58 +0200)]
qdevice: Make simple-lex locale independent

Simple-lex is going to be used in protocol so it's not good idea to
depend on locale.

Signed-off-by: Jan Friesse <jfriesse@redhat.com>
8 years agoquorum: Return qdevice nodeid in the quorum callbacks (if active).
Christine Caulfield [Fri, 8 Apr 2016 13:16:05 +0000 (14:16 +0100)]
quorum: Return qdevice nodeid in the quorum callbacks (if active).

Signed-off-by: Christine Caulfield <ccaulfie@redhat.com>
8 years agoqdevice: Improve socket based IPC
Jan Friesse [Fri, 1 Apr 2016 14:34:08 +0000 (16:34 +0200)]
qdevice: Improve socket based IPC

Signed-off-by: Jan Friesse <jfriesse@redhat.com>
8 years agoqnetd: Factorize qnetd-poll-array to generic unit
Jan Friesse [Fri, 1 Apr 2016 08:27:44 +0000 (10:27 +0200)]
qnetd: Factorize qnetd-poll-array to generic unit

Signed-off-by: Jan Friesse <jfriesse@redhat.com>
8 years agoqdevice: Add preliminary version of IPC
Jan Friesse [Tue, 29 Mar 2016 15:52:14 +0000 (17:52 +0200)]
qdevice: Add preliminary version of IPC

Signed-off-by: Jan Friesse <jfriesse@redhat.com>
8 years agoqdevice: Add qdevice service scripts
Jan Friesse [Thu, 24 Mar 2016 15:44:38 +0000 (16:44 +0100)]
qdevice: Add qdevice service scripts

Also fix qnetd systemd service.

Signed-off-by: Jan Friesse <jfriesse@redhat.com>
8 years agoqdevice: Remove compiler warning
Jan Friesse [Thu, 24 Mar 2016 15:43:17 +0000 (16:43 +0100)]
qdevice: Remove compiler warning

Signed-off-by: Jan Friesse <jfriesse@redhat.com>
8 years agoqdevice: Unregister votequorum tracking on exit
Jan Friesse [Thu, 24 Mar 2016 15:28:03 +0000 (16:28 +0100)]
qdevice: Unregister votequorum tracking on exit

Signed-off-by: Jan Friesse <jfriesse@redhat.com>
8 years agoqdevice: Add support for daemonize
Jan Friesse [Thu, 24 Mar 2016 15:07:28 +0000 (16:07 +0100)]
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>
8 years agoqdevice-net: Add option to force ip version
Jan Friesse [Tue, 22 Mar 2016 16:28:51 +0000 (17:28 +0100)]
qdevice-net: Add option to force ip version

Signed-off-by: Jan Friesse <jfriesse@redhat.com>
8 years agoqnetd: Add dead peer (client) detection
Jan Friesse [Mon, 21 Mar 2016 16:24:13 +0000 (17:24 +0100)]
qnetd: Add dead peer (client) detection

Signed-off-by: Jan Friesse <jfriesse@redhat.com>
8 years agoqdevice timer-list: Add reschedule operation
Jan Friesse [Fri, 18 Mar 2016 16:24:08 +0000 (17:24 +0100)]
qdevice timer-list: Add reschedule operation

Signed-off-by: Jan Friesse <jfriesse@redhat.com>
8 years agoqdevice: Wait a while before reconnect
Jan Friesse [Fri, 18 Mar 2016 15:20:59 +0000 (16:20 +0100)]
qdevice: Wait a while before reconnect

It's viable to give qnetd a little time before client tries reconnect.

Signed-off-by: Jan Friesse <jfriesse@redhat.com>
8 years agoqnetd: Replace err by qnetd_log on some places
Jan Friesse [Fri, 18 Mar 2016 15:00:07 +0000 (16:00 +0100)]
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>
8 years agoqnetd: Validate tie-breaker, algo and node dup
Jan Friesse [Fri, 18 Mar 2016 14:58:40 +0000 (15:58 +0100)]
qnetd: Validate tie-breaker, algo and node dup

If new client request tie-breaker or algo which differes from rest of
cluster, error message is sent back. Also it's checked if node is not
duplicate by comparing node id.

Signed-off-by: Jan Friesse <jfriesse@redhat.com>
8 years agoqdevice-lms: improvements to LMS algorithm
Christine Caulfield [Fri, 18 Mar 2016 13:13:36 +0000 (13:13 +0000)]
qdevice-lms: improvements to LMS algorithm

Use the new timers to get better response from LMS when the network
splits, this also closes a race where the remote side could go inquorate
before we confirmed the vote.

Add client-side (qdevice-net) code to cope with a detached qnetd if we
are quorate and have wait_for_all enabled. THat situation will now
keep quorum.

Signed-off-by: Christine Caulfield <ccaulfie@redhat.com>
8 years agoqdevice: Allow delete timer withing it's callback
Jan Friesse [Fri, 18 Mar 2016 11:57:45 +0000 (12:57 +0100)]
qdevice: Allow delete timer withing it's callback

Signed-off-by: Jan Friesse <jfriesse@redhat.com>
8 years agoqdevice: Force send of heartbeat
Jan Friesse [Fri, 18 Mar 2016 09:40:58 +0000 (10:40 +0100)]
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>
8 years agoqdevice: Improve timer-list
Jan Friesse [Fri, 18 Mar 2016 08:30:55 +0000 (09:30 +0100)]
qdevice: Improve timer-list

Timer-list is now more efficient and as a side-effect it's possible to
add/delete timer in callback.

Signed-off-by: Jan Friesse <jfriesse@redhat.com>
8 years agoqnetd: Add support for qnetd algo timer
Jan Friesse [Thu, 17 Mar 2016 13:00:26 +0000 (14:00 +0100)]
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>
8 years agoqdevice-net: Allow connect to choose lists to send
Jan Friesse [Mon, 14 Mar 2016 16:40:00 +0000 (17:40 +0100)]
qdevice-net: Allow connect to choose lists to send

Also disconnect and connect can now affect vote timer.

Signed-off-by: Jan Friesse <jfriesse@redhat.com>
8 years agoqnetd-algo-utils: Remove goto
Jan Friesse [Mon, 14 Mar 2016 10:00:45 +0000 (11:00 +0100)]
qnetd-algo-utils: Remove goto

Signed-off-by: Jan Friesse <jfriesse@redhat.com>
8 years agoqdevice-net: Support tls required and fix leaks
Jan Friesse [Mon, 14 Mar 2016 09:20:07 +0000 (10:20 +0100)]
qdevice-net: Support tls required and fix leaks

Signed-off-by: Jan Friesse <jfriesse@redhat.com>
8 years agoqdevice tlv: Remove default/return code redundancy
Jan Friesse [Mon, 14 Mar 2016 09:19:08 +0000 (10:19 +0100)]
qdevice tlv: Remove default/return code redundancy

Signed-off-by: Jan Friesse <jfriesse@redhat.com>
8 years agoqdevice-net: Free send buffer on error (leak)
Jan Friesse [Mon, 14 Mar 2016 09:17:35 +0000 (10:17 +0100)]
qdevice-net: Free send buffer on error (leak)

Signed-off-by: Jan Friesse <jfriesse@redhat.com>
8 years agoqnetd: Return lock file fd
Jan Friesse [Mon, 14 Mar 2016 09:16:21 +0000 (10:16 +0100)]
qnetd: Return lock file fd

Signed-off-by: Jan Friesse <jfriesse@redhat.com>
8 years agoqdevice-net: Ensure to free non blocking client
Jan Friesse [Mon, 14 Mar 2016 08:19:41 +0000 (09:19 +0100)]
qdevice-net: Ensure to free non blocking client

Signed-off-by: Jan Friesse <jfriesse@redhat.com>
8 years agoRefactor qdevice-net
Jan Friesse [Mon, 22 Feb 2016 15:46:45 +0000 (16:46 +0100)]
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>
8 years agovotequorum: Allow wait_for_all with qdevice
Christine Caulfield [Thu, 18 Feb 2016 16:52:41 +0000 (16:52 +0000)]
votequorum: Allow wait_for_all with qdevice

Signed-off-by: Christine Caulfield <ccaulfie@redhat.com>
8 years agoqnetd: Use ring_id, not client->last_ring_id in algorithms
Christine Caulfield [Tue, 16 Feb 2016 15:42:47 +0000 (15:42 +0000)]
qnetd: Use ring_id, not client->last_ring_id in algorithms

ring_id should only be copied into the client structure after the
algorithm has run (so the last one is also available), so fix the
algorithms to use the passed-in ring_id where available.

Also tidy some debug logging in algo-lms

Signed-off-by: Christine Caulfield <ccaulfie@redhat.com>
8 years agoqnetd-algo: Fix list traversal corruption when freeing partitions.
Christine Caulfield [Tue, 16 Feb 2016 14:30:24 +0000 (14:30 +0000)]
qnetd-algo: Fix list traversal corruption when freeing partitions.

TAILQ_* doesn't have a safe iterator for use when freeing entries, so the
only safe way of doing it (without assuming implementation) is to
restart the iterator after freeing the structure.

Signed-off-by: Christine Caulfield <ccaulfie@redhat.com>
8 years agoImprove qdevice
Jan Friesse [Mon, 1 Feb 2016 11:26:08 +0000 (12:26 +0100)]
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>
8 years agoqnetd-algo: Refactor common routines
Christine Caulfield [Tue, 26 Jan 2016 16:03:10 +0000 (16:03 +0000)]
qnetd-algo: Refactor common routines

Move several commonly used routines into their own
qnetd-algo-utils.[ch] files and change over to using
the ring_id held in the client structure rather than
managint it ourself.

Signed-off-by: Christine Caulfield <ccaulfie@redhat.com>
8 years agoqnetd: Add ring_id to client structure
Christine Caulfield [Tue, 26 Jan 2016 15:58:55 +0000 (15:58 +0000)]
qnetd: Add ring_id to client structure

Signed-off-by: Christine Caulfield <ccaulfie@redhat.com>
8 years agoalgo-lms: some tidying
Christine Caulfield [Tue, 22 Dec 2015 14:36:05 +0000 (14:36 +0000)]
algo-lms: some tidying

Signed-off-by: Christine Caulfield <ccaulfie@redhat.com>
8 years agoqnetd: Make proper support for ipv4/6
Jan Friesse [Wed, 16 Dec 2015 17:19:24 +0000 (18:19 +0100)]
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>
8 years agoqnetd: Add init script
Jan Friesse [Mon, 14 Dec 2015 17:27:09 +0000 (18:27 +0100)]
qnetd: Add init script

Signed-off-by: Jan Friesse <jfriesse@redhat.com>
8 years agoqnetd: Refactor
Jan Friesse [Mon, 14 Dec 2015 17:16:50 +0000 (18:16 +0100)]
qnetd: Refactor

Signed-off-by: Jan Friesse <jfriesse@redhat.com>
8 years agoqnetd: Really daemonize
Jan Friesse [Mon, 7 Dec 2015 17:10:01 +0000 (18:10 +0100)]
qnetd: Really daemonize

Signed-off-by: Jan Friesse <jfriesse@redhat.com>
8 years agoqdevice: qnetd_algo_lms: Fix nominated tie_breaker node
Christine Caulfield [Thu, 26 Nov 2015 11:02:45 +0000 (11:02 +0000)]
qdevice: qnetd_algo_lms: Fix nominated tie_breaker node

Signed-off-by: Christine Caulfield <ccaulfie@redhat.com>
8 years agoqnetd: lms: Add support for other tie_breaker options.
Christine Caulfield [Fri, 20 Nov 2015 11:30:31 +0000 (11:30 +0000)]
qnetd: lms: Add support for other tie_breaker options.

Signed-off-by: Christine Caulfield <ccaulfie@redhat.com>
8 years agoqnetd: Add tie_breaker options to 2nodelms
Christine Caulfield [Tue, 17 Nov 2015 14:33:10 +0000 (14:33 +0000)]
qnetd: Add tie_breaker options to 2nodelms

Signed-off-by: Christine Caulfield <ccaulfie@redhat.com>
8 years agoqdevice: Add tie_breaker option
Jan Friesse [Wed, 11 Nov 2015 16:51:05 +0000 (17:51 +0100)]
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>
8 years agoqnet: Add TLV_VOTE_NO_CHANGE
Jan Friesse [Fri, 6 Nov 2015 08:58:57 +0000 (09:58 +0100)]
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>
8 years agoqnet: Migrate to new votequorum API
Jan Friesse [Wed, 4 Nov 2015 18:05:54 +0000 (19:05 +0100)]
qnet: Migrate to new votequorum API

Signed-off-by: Jan Friesse <jfriesse@redhat.com>
8 years agoqdevice: 2nodelms: don't split-brain when the primary node comes back.
Christine Caulfield [Mon, 2 Nov 2015 11:32:23 +0000 (11:32 +0000)]
qdevice: 2nodelms: don't split-brain when the primary node comes back.

Signed-off-by: Christine Caulfield <ccaulfie@redhat.com>
8 years agoqnetd: lms: Fix search for node/ring_id check
Christine Caulfield [Fri, 30 Oct 2015 15:13:30 +0000 (15:13 +0000)]
qnetd: lms: Fix search for node/ring_id check

We were looking for us in other node lists, rather than
others in our nodelist.

Also, remove debug print in votequorum.c

Signed-off-by: Christine Caulfield <ccaulfie@redhat.com>
8 years agovotequorum: Fix up quorum/nodelist callbacks
Christine Caulfield [Thu, 29 Oct 2015 11:22:47 +0000 (11:22 +0000)]
votequorum: Fix up quorum/nodelist callbacks

This patch tidies the two state change callbacks and explains them
in the man page:

The difference between votequorum_nodelist_notification_t and
votequorum_quorum_notification_t is subtle but important.
The 'nodelist' callback is sent at the start of a cluster state
transition and contains the new ring_id and only the list of
nodes that are included in the sync state - ie only active nodes. No
quorum information is included this callback because it is not
available at that time.

The 'quorum' callback is sent after the cluster state transition has
completed and does contain quorum information.
In addition, the nodelist contains a list of all nodes known to
votequorum (whether up or down) and their state as well
as information about the quorum device attached (if any). quorum
callbacks will not be sent for qdevice up and down
events unless they affect quorum.

Signed-off-by: Christine Caulfield <ccaulfie@redhat.com>
8 years agoqnetd: Some small improvements
Jan Friesse [Tue, 27 Oct 2015 15:40:23 +0000 (16:40 +0100)]
qnetd: Some small improvements

Signed-off-by: Jan Friesse <jfriesse@redhat.com>
8 years agoqnetd: Improve logging
Jan Friesse [Mon, 26 Oct 2015 16:48:49 +0000 (17:48 +0100)]
qnetd: Improve logging

Signed-off-by: Jan Friesse <jfriesse@redhat.com>
8 years agovotequorum: split callbacks into nodelist and quorum
Christine Caulfield [Fri, 23 Oct 2015 12:11:42 +0000 (13:11 +0100)]
votequorum: split callbacks into nodelist and quorum

This split is needed for qdevice, so that it gets the ring_id and
nodelist as part of the sync process and not afterwards - when quorum
has been calculated.

As this is and unsupported API I'm not too worried about breaking
existing code - all the clients I know of are using the quorum API
anyway as they should be.

Signed-off-by: Christine Caulfield <ccaulfie@redhat.com>
8 years agoqdevice-net: Copy correct ring id in votequorum cb
Jan Friesse [Thu, 22 Oct 2015 14:31:42 +0000 (16:31 +0200)]
qdevice-net: Copy correct ring id in votequorum cb

Signed-off-by: Jan Friesse <jfriesse@redhat.com>
8 years agoqnetd: Add LMS algorithm
Christine Caulfield [Thu, 22 Oct 2015 13:47:12 +0000 (14:47 +0100)]
qnetd: Add LMS algorithm

Only lightly tested so far

Signed-off-by: Christine Caulfield <ccaulfie@redhat.com>
8 years agoImprove qdevice-net
Jan Friesse [Tue, 20 Oct 2015 14:10:12 +0000 (16:10 +0200)]
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>
8 years agovotequorum: make corosync_quorumtool show full ring_id
Christine Caulfield [Tue, 20 Oct 2015 14:36:46 +0000 (15:36 +0100)]
votequorum: make corosync_quorumtool show full ring_id

Add the ring leader node_id to corosync_quorumtool. This is
only shown when votequorum is active

Signed-off-by: Christine Caulfield <ccaulfie@redhat.com>
8 years agoqnetd: move 2nodelms algo files to the right directory
Christine Caulfield [Fri, 16 Oct 2015 08:42:07 +0000 (09:42 +0100)]
qnetd: move 2nodelms algo files to the right directory

No, I don't know how that happened.

Signed-off-by: Christine Caulfield <ccaulfie@redhat.com>
8 years agoqdevice-net: add a 2node Last Man Standing algorithm
Christine Caulfield [Fri, 9 Oct 2015 13:11:10 +0000 (14:11 +0100)]
qdevice-net: add a 2node Last Man Standing algorithm
Signed-off-by: Christine Caulfield <ccaulfie@redhat.com>
8 years agoqdevice-net: Implement missing messages handlers
Jan Friesse [Thu, 8 Oct 2015 16:01:42 +0000 (18:01 +0200)]
qdevice-net: Implement missing messages handlers

Signed-off-by: Jan Friesse <jfriesse@redhat.com>
8 years agoqnetd-certutil: Fix master node variable
Jan Friesse [Thu, 8 Oct 2015 15:44:50 +0000 (17:44 +0200)]
qnetd-certutil: Fix master node variable

Signed-off-by: Jan Friesse <jfriesse@redhat.com>
8 years agocorosync-qnetd-certutil: Delete tabs
Jan Friesse [Tue, 6 Oct 2015 15:53:49 +0000 (17:53 +0200)]
corosync-qnetd-certutil: Delete tabs

Signed-off-by: Jan Friesse <jfriesse@redhat.com>
8 years agocorosync-qnetd-certutil: Delete dev comment
Jan Friesse [Tue, 6 Oct 2015 15:52:37 +0000 (17:52 +0200)]
corosync-qnetd-certutil: Delete dev comment

Signed-off-by: Jan Friesse <jfriesse@redhat.com>
8 years agoqnetd: Move algorithms_register into qnetd-algorithms.c
Christine Caulfield [Tue, 6 Oct 2015 15:52:40 +0000 (16:52 +0100)]
qnetd: Move algorithms_register into qnetd-algorithms.c

and fix qnetd_algorithm_vote_info_reply_received

Signed-off-by: Christine Caulfield <ccaulfie@redhat.com>
8 years agocorosync-qnetd-certutl: Improvements
Jan Friesse [Tue, 6 Oct 2015 15:31:20 +0000 (17:31 +0200)]
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>
8 years agoqnetd: Make it easier to add algorithms
Christine Caulfield [Tue, 6 Oct 2015 12:40:03 +0000 (13:40 +0100)]
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>
8 years agoDon't attempt to free a string we haven't been given.
Christine Caulfield [Tue, 6 Oct 2015 09:51:46 +0000 (10:51 +0100)]
Don't attempt to free a string we haven't been given.

Signed-off-by: Christine Caulfield <ccaulfie@redhat.com>
8 years agoqnetd: Improvements
Jan Friesse [Fri, 2 Oct 2015 06:54:05 +0000 (08:54 +0200)]
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>
8 years agoqnetd: Add skel of ffsplit algo and cluster list
Jan Friesse [Thu, 1 Oct 2015 14:23:03 +0000 (16:23 +0200)]
qnetd: Add skel of ffsplit algo and cluster list

Signed-off-by: Jan Friesse <jfriesse@redhat.com>
8 years agoQnetd improvements
Jan Friesse [Thu, 1 Oct 2015 07:58:01 +0000 (09:58 +0200)]
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>
8 years agoQnet improvements
Jan Friesse [Wed, 30 Sep 2015 08:07:23 +0000 (10:07 +0200)]
Qnet improvements

- Support for membership node list
- Initial support for "pluggable" algorithms

Signed-off-by: Jan Friesse <jfriesse@redhat.com>
8 years agoQdevices-net improvements
Jan Friesse [Wed, 9 Sep 2015 14:10:13 +0000 (16:10 +0200)]
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>
8 years agovotequorum: Make display of qdevice more intuitive.
Christine Caulfield [Tue, 8 Sep 2015 12:41:37 +0000 (13:41 +0100)]
votequorum: Make display of qdevice more intuitive.

corosync-quorumtool displays the votes of the qdevice whether
or not it is active. This is confusing because if it is not active
then the display looks like there is a vote being contributed to
quorum when there is not.

This patch displays 0 for qdevice votes if the device is present
(but inactive) and adds the votes after the name. If the device is
contributing votes then they are displayed as normal.

Signed-off-by: Christine Caulfield <ccaulfie@redhat.com>
8 years agoImprove qnet
Jan Friesse [Tue, 1 Sep 2015 15:25:53 +0000 (17:25 +0200)]
Improve qnet

8 years agoInitial commit of qdevice net
Jan Friesse [Mon, 15 Jun 2015 14:42:18 +0000 (16:42 +0200)]
Initial commit of qdevice net