#5466 closed enhancement (complete)

HA: Database fetching and synchronization

Reported by: tomek Owned by: marcin
Priority: medium Milestone: Kea1.4
Component: high-availability Version: git
Keywords: Cc:
CVSS Scoring: Parent Tickets:
Sensitive: no Defect Severity: N/A
Sub-Project: DHCP Feature Depending on Ticket:
Estimated Difficulty: 0 Add Hours to Ticket: 0
Total Hours: 0 Internal?: no

Description

HADesign uses database fetching and synchronization. There are two aspects of this mechanism:

  • "client" side, where the server is able to send a request to its partner to retrieve all leases and then properly process responses and update its own local database. This is covered by this (#5466) ticket.
  • "server" side, where the server is requested by its partner to provide its leases. This covers going through its own database and sending all (or selected) leases. This is covered by #5468 ticket.

This ticket is about v4 aspect of the client-side. For v6 counter-part, see #5467.

Subtickets

Change History (6)

comment:1 Changed 13 months ago by marcin

  • Owner set to marcin
  • Status changed from new to accepted

comment:2 Changed 13 months ago by marcin

  • Owner changed from marcin to UnAssigned
  • Status changed from accepted to reviewing

I have added a new function into the hook library which issues lease4-get-all command and then iterates over the returned leases and puts them into the local database. To be able to do it, I also had to add new methods into Lease4 and Lease6 classes in libkea-dhcpsrv to parse lease information from JSON.

The following are the proposed ChangeLogs:

13XX.	[func]		marcin
	Implemented leases parsing from JSON in libkea-dhcpsrv.
	(Trac #5464, git cafe)

and

XX.	[func]		marcin
	Implemented leases fetching and local lease database synchronization
	in the libkea-ha hooks library.
	(Trac #5464, git cafe)

comment:3 Changed 13 months ago by marcin

The code must be compiled from trac5466 branch of open source Kea and trac5466 of premium.

comment:4 Changed 13 months ago by tmark

  • Owner changed from UnAssigned to tmark

comment:5 Changed 13 months ago by tmark

  • Owner changed from tmark to marcin

This review covers only the changes made under the main Kea repo, under git commit 2901009ee4bc911f27bbf847d1eb30d39bf0d9b1. The changes made to premium were reviewed as part of #5476.

src/lib/dhcpsrv/lease.cc

Lease::fromElementCommon()

Since this is common, I think any logic that is v4/v6 specific
should be moved to their respective Lease derivation's function.

You can still set the ip_adress in this function but validate for v4/v6
in their respective functions.

Similarly with hw_address, set it here but validate it in the v4
function (i.e. for V4 it can't be blank, for v6 you don't care).

This function then doesn't have to worry about static casting to
set a bool, is_v6, that it doesn't need for tests it no longer has to make.

Beyond that the main repo changes are fine.

comment:6 Changed 13 months ago by marcin

  • Resolution set to complete
  • Status changed from reviewing to closed

I addressed the review comments above and merged with commit 84c2a2084b0fb7c086fc6b9502f7ff58b708174e

Note: See TracTickets for help on using tickets.