haproxy/dev
Willy Tarreau bff33b4e32 DEV: patchbot: update: support replacing a whole note blob (setnotes)
Notes are append-only on the wire, which makes concurrent edits
conflict-free but leaves no way to revise or clean up a note from the
page: fixing a note requires a hand-edit of the storage file. This adds
the replacement directive that the design had reserved:

    <cid> setnotes <hash> <replacement text>

Unlike the other directives, a replacement must carry a token of the
base it was computed from, or it could silently destroy a concurrent
update (one reviewer's append landing between another's read and
replace). The token is the SDBM hash (8 hex chars) of the note blob
the client based its edit on: the server only applies the replacement
if it still matches the stored blob (empty-string hash for a commit
without notes). On mismatch the directive is dropped, the line is left
exactly as found, and a "conflict <cid>" line is emitted in the
response before the resulting lines so that the client can point the
user at what needs manual reconciliation; other directives from the
same POST are still applied, and nothing is written nor committed when
everything conflicted. SDBM is trivially computed on both sides (a
concurrency token, not a security feature, and JS crypto is unavailable
on plain http anyway), and its small multiplier keeps the whole hash
computation exact in awk's double-precision arithmetic, which is
precisely why it was chosen over wider-multiplier hashes.

An empty replacement deletes the notes (and the line if no state is
left), finally allowing obsolete notes to be removed without editing
the file by hand. Replacements are capped to 4000 chars instead of the
500-char append cap, since a coalesced blob may legitimately have grown
beyond a single addition.
2026-07-07 14:45:32 +02:00
..
base64 CONTRIB: move some dev-specific tools to dev/ 2021-04-02 17:48:42 +02:00
coccinelle DEV: coccinelle: add a test to detect unchecked calloc() 2024-08-24 19:13:56 +02:00
flags DEV: lags/show-sess-to-flags: Properly handle fd state on server side 2024-11-25 21:57:30 +01:00
gdb DEV: dev/gdb: add fdtab dump 2026-06-01 19:08:42 +02:00
h2 DEV: h2: fix h2-tracer.lua nil value index 2025-04-08 17:44:41 +02:00
haring CLEANUP: use the automatic alignment feature 2025-12-09 17:14:58 +01:00
hpack DEV: hpack: fix trash build regression 2023-01-27 10:22:20 +01:00
ncpu DEV: ncpu: also emulate sysconf() for _SC_NPROCESSORS_* 2025-03-14 18:30:30 +01:00
patchbot DEV: patchbot: update: support replacing a whole note blob (setnotes) 2026-07-07 14:45:32 +02:00
phash BUILD: dev/phash: remove the accidentally committed a.out file 2025-07-02 10:55:13 +02:00
plug_qdisc CONTRIB: move some dev-specific tools to dev/ 2021-04-02 17:48:42 +02:00
poll DEV: poll: add support for epoll 2022-11-25 17:07:22 +01:00
qpack MINOR: qpack: implement standalone decoder tool 2022-06-15 15:42:10 +02:00
sslkeylogger DEV: sslkeylogger: handle file opening error 2023-10-03 15:23:35 +02:00
tcploop DEV: tcploop: add minimal support for unix sockets 2023-01-11 11:27:20 +01:00
term_events DEV: term-events: Fix hanshake events decoding 2026-02-18 09:44:15 +01:00
trace CONTRIB: move some dev-specific tools to dev/ 2021-04-02 17:48:42 +02:00
udp BUILD: address a few remaining calloc(size, n) cases 2024-02-10 11:37:27 +01:00