haproxy/doc
Aurelien DARRAGON 5158c0ff69 MEDIUM: stktable/peers: "write-to" local table on peer updates
In this patch, we add the possibility to declare on a table definition
("table" in peer section, or "stick-table" in proxy section) that we
want the remote/peer updates on that table to be pushed on a local
haproxy table in addition to the source table.

Consider this example:

  |peers mypeers
  |        peer local 127.0.0.1:3334
  |        peer clust 127.0.0.1:3333
  |        table t1.local type string size 10m store server_id,server_key expire 30s
  |        table t1.clust type string size 10m store server_id,server_key write-to mypeers/t1.local expire 30s

With this setup, we consider haproxy uses t1.local as cache/local table
for read and write operations, and that t1.clust is a remote table
containing datas processed from t1.local and similar tables from other
haproxy peers in a cluster setup. The t1.clust table will be used to
refresh the local/cache one via the "write-to" statement.

What will happen, is that every time haproxy will see entry updates for
the t1.clust table: it will overwrite t1.local table with fresh data and
will update the entry expiration timer. If t1.local entry doesn't exist
yet (key doesn't exist), it will automatically create it. Note that only
types that cannot be used for arithmetic ops will be handled, and this
to prevent processed values from the remote table from interfering with
computations based on values from the local table. (ie: prevent
cumulative counters from growing indefinitely).

"write-to" will only push supported types if they both exist in the source
and the target table. Be careful with server_id and server_key storage
because they are often declared implicitly when referencing a table in
sticking rules but it is required to declare them explicitly for them to
be pushed between a remote and a local table through "write-to" option.

Also note that the "write-to" target table should have the same type as
the source one, and that the key length should be strictly equal,
otherwise haproxy will raise an error due to the tables being
incompatibles. A table that is already being written to cannot be used
as a source table for a "write-to" target.

Thanks to this patch, it will now be possible to use sticking rules in
peer cluster context by using a local table as a local cache which
will be automatically refreshed by one or multiple remote table(s).

This commit depends on:
 - "MINOR: stktable: stktable_init() sets err_msg on error"
 - "MINOR: stktable: check if a type should be used as-is"
2023-11-03 17:30:30 +01:00
..
design-thoughts CLEANUP: doc: remove 21 totally obsolete docs 2023-05-31 15:17:28 +02:00
internals DOC: internal: filters: fix reference to entities.pdf 2023-10-23 11:33:45 +02:00
lua-api MINOR: lua: change tune.lua.log.stderr default from 'on' to 'auto' 2023-10-25 07:49:03 +02:00
51Degrees-device-detection.txt BUILD: makefile: refactor support for 51DEGREES v3/v4 2022-12-23 16:53:35 +01:00
acl.fig
architecture.txt
coding-style.txt
configuration.txt MEDIUM: stktable/peers: "write-to" local table on peer updates 2023-11-03 17:30:30 +01:00
cookie-options.txt
DeviceAtlas-device-detection.txt
gpl.txt
haproxy.1
intro.txt [RELEASE] Released version 2.9-dev0 2023-05-31 16:29:19 +02:00
lgpl.txt
linux-syn-cookies.txt
lua.txt MINOR: lua: change tune.lua.log.stderr default from 'on' to 'auto' 2023-10-25 07:49:03 +02:00
management.txt [RELEASE] Released version 2.9-dev0 2023-05-31 16:29:19 +02:00
netscaler-client-ip-insertion-protocol.txt
network-namespaces.txt
peers-v2.0.txt CLEANUP: assorted typo fixes in the code and comments 2022-12-07 09:08:18 +01:00
peers.txt CLEANUP: assorted typo fixes in the code and comments 2022-12-07 09:08:18 +01:00
proxy-protocol.txt DOC: proxy-protocol: fix wrong byte in provided example 2023-02-12 09:26:48 +01:00
queuing.fig
regression-testing.txt
seamless_reload.txt
SOCKS4.protocol.txt
SPOE.txt CLEANUP: assorted typo fixes in the code and comments 2023-04-01 18:33:40 +02:00
WURFL-device-detection.txt