MINOR: stream: add an "epoch" to figure which streams appeared when
authorWilly Tarreau <w@1wt.eu>
Wed, 24 Feb 2021 10:29:51 +0000 (11:29 +0100)
committerWilly Tarreau <w@1wt.eu>
Wed, 10 Mar 2021 14:11:16 +0000 (15:11 +0100)
commit907988ad376304bd9aefb621045dcf803152b1ae
treeea9a09d157436c9e447751ad11d8dfab304360ed
parent132b3a49dc59fe03be10a8e7ccfc50374b218ce5
MINOR: stream: add an "epoch" to figure which streams appeared when

The "show sess" CLI command currently lists all streams and needs to
stop at a given position to avoid dumping forever. Since 2.2 with
commit c6e7a1b8e ("MINOR: cli: make "show sess" stop at the last known
session"), a hack consists in unlinking the stream running the applet
and linking it again at the current end of the list, in order to serve
as a delimiter. But this forces the stream list to be global, which
affects scalability.

This patch introduces an epoch, which is a global 32-bit counter that
is incremented by the "show sess" command, and which is copied by newly
created streams. This way any stream can know whether any other one is
newer or older than itself.

For now it's only stored and not exploited.

(cherry picked from commit b981318c11ce8c1969b931b01d51be38dbbaa4a7)
Signed-off-by: Willy Tarreau <w@1wt.eu>
include/haproxy/stream-t.h
src/stream.c