summaryrefslogtreecommitdiff
path: root/includes/failover.h
diff options
context:
space:
mode:
authorDamien Neil <source@isc.org>2001-02-22 00:15:54 +0000
committerDamien Neil <source@isc.org>2001-02-22 00:15:54 +0000
commit988c1ca71f731c4933eb62e0492cdaf9f1156917 (patch)
tree868cdaf6280a791a195a681e7bf67d6be433d25c /includes/failover.h
parente6d30fd63279cd83e7320be8c4f32f5e827d5dde (diff)
downloadisc-dhcp-988c1ca71f731c4933eb62e0492cdaf9f1156917.tar.gz
Added failover ack queueing. Failover update messages are no longer
immediately responded to, but are placed on a queue (attached to the dhcp_failover_state_t structure). Updated leases are committed only when the queue is drained, giving a significant performance increase. The toack queue is drained: a) when the queue size exceeds half the partner's max-unacked-updates setting, or b) two seconds after the last update message is received. Added 'refcnt' and 'next' fields to the failover_message_t structure, to allow messages to be placed on the toack queue. On the sending side, leases are no longer committed immediately after being acked. Rather, the commit is deferred until no further acks are pending. This also gives a major gain in performance.
Diffstat (limited to 'includes/failover.h')
-rw-r--r--includes/failover.h12
1 files changed, 11 insertions, 1 deletions
diff --git a/includes/failover.h b/includes/failover.h
index 36b7ffbd..fbd9bedd 100644
--- a/includes/failover.h
+++ b/includes/failover.h
@@ -161,7 +161,10 @@ typedef struct {
/* Failover server flags. */
#define FTF_STARTUP 1
-typedef struct {
+typedef struct failover_message {
+ int refcnt;
+ struct failover_message *next;
+
u_int8_t type;
u_int8_t binding_status;
@@ -303,6 +306,13 @@ typedef struct _dhcp_failover_state {
lease, send an UPDDONE message. */
int cur_unacked_updates; /* Number of updates we've sent
that have not yet been acked. */
+
+ /* List of messages which we haven't
+ acked yet. */
+ failover_message_t *toack_queue_head;
+ failover_message_t *toack_queue_tail;
+ int pending_acks; /* Number of messages in the toack
+ queue. */
} dhcp_failover_state_t;
#define DHCP_FAILOVER_VERSION 1