From c1c9aa87d9d6550b43c734c75b8f2e1dec0035e6 Mon Sep 17 00:00:00 2001 From: Marcin Siodelski Date: Fri, 8 Jan 2021 10:56:45 +0100 Subject: [PATCH] [#1402] Added a note in lease_update_backlog.h Explained why the lease updates backlog is implemented in terms of a single std::deque, as requested in review comment. --- .../dhcp/high_availability/lease_update_backlog.h | 11 +++++++++++ 1 file changed, 11 insertions(+) diff --git a/src/hooks/dhcp/high_availability/lease_update_backlog.h b/src/hooks/dhcp/high_availability/lease_update_backlog.h index 17fedbd33c..cf888912e1 100644 --- a/src/hooks/dhcp/high_availability/lease_update_backlog.h +++ b/src/hooks/dhcp/high_availability/lease_update_backlog.h @@ -31,6 +31,17 @@ namespace ha { /// /// There are two types of lease updates: "Add" and "Delete". The type /// is specified when the lease is appended to the queue. +/// +/// The backlog queue holds both "Add" and "Delete" lease updates in a +/// single std::deque container, which allows for ordering them +/// chronologically and using this ordering for queue optimizations in +/// the future. For example, if the queue contains consecutive "Delete" +/// updates for a particular IP address, the server could only delete +/// the lease once. If the queue contains multiple "Delete" lease updates +/// followed by an "Add" update, the server could skip sending "Delete" +/// updates. +/// +/// Queue optimizations will be subject to future work! class LeaseUpdateBacklog { public: