]> git.ipfire.org Git - thirdparty/haproxy.git/commit
MINOR: server: add srv->rid (revision id) value
authorAurelien DARRAGON <adarragon@haproxy.com>
Thu, 17 Nov 2022 15:10:35 +0000 (16:10 +0100)
committerChristopher Faulet <cfaulet@haproxy.com>
Tue, 6 Dec 2022 09:22:06 +0000 (10:22 +0100)
commit61e3894dfeba54bc4d6a2ae3c0dd708850e8320e
tree7e9d67d3d81c06c324198023875b0641a6049142
parent7f59d68fe272c677e577523b3fe866f2b22a56ab
MINOR: server: add srv->rid (revision id) value

With current design, we could not distinguish between
previously existing deleted server and a new server reusing
the deleted server name/id.

This can cause some confusion when auditing stats/events/logs,
because the new server will look similar to the old
one.

To address this, we're adding a new value in server structure: rid

rid (revision id) value is an unsigned 32bits value that is set upon
server creation. Value is derived from a global counter that starts
at 0 and is incremented each time one or multiple server deletions are
followed by a server addition (meaning that old name/id reuse could occur).

Thanks to this revision id, it is now easy to tell whether the server
we're looking at is the same as before or if it has been deleted and
re-added in the meantime.
(combining server name/id + server revision id yields a process-wide unique
identifier)
include/haproxy/server-t.h
src/server.c