[kea-dev] On persistent lease file clean-up mechanism

Chaigneau, Nicolas nicolas.chaigneau at capgemini.com
Wed Nov 19 14:27:35 UTC 2014


I'd like to discuss the topic of cleaning-up the lease file in the case of a "memfile" back-end.
That's probably something you've already thought of, but I didn't find specific implementation discussed of on the mailing list archive.
Since it's still yet to be implemented, I'd like to share my 2 cents on the subject.

This is not a trivial matter: in the context of high availability and very large lease files involved, the situation of a server being unresponsive for several seconds while it handles rewriting the lease file is not something we can afford.

So here's how I would do it:
- define a lease file clean-up interval; for instance 1H.
- every 1H, trigger the clean-up mechanism:
    - rename <lease file> to <old lease file> (<lease file>~ or any other naming convention)
    - recreate an empty <lease file>
    - close and reopen Kea's file handle on <lease file>
- at server startup, load in memory both <lease file> and <old lease file> (aggregating their content)

If we ensure that the clean-up interval value is *at least* equal to the maximum lease time value, this guarantee no data can be lost during a server restart: any lease not expired is necessarily either in the current or old lease file (possibly both).

Both <lease file> and <old lease file> being in the same directory, hence on the same filesystem, the rename operation is immediate. The file's inode and content are unchanged. Only the file name is modified.

This probably would not be suitable for everyone's needs, so maybe this could be an optional mechanism.

What do you think ?


This message contains information that may be privileged or confidential and is the property of the Capgemini Group. It is intended only for the person to whom it is addressed. If you are not the intended recipient, you are not authorized to read, print, retain, copy, disseminate, distribute, or use this message or any part thereof. If you receive this message in error, please notify the sender immediately and delete all copies of this message.

More information about the kea-dev mailing list