libpq: Fix lots of discrepancies in PQtrace

From: Jelte Fennema-Nio <postgres(at)jeltef(dot)nl>
To: PostgreSQL Hackers <pgsql-hackers(at)lists(dot)postgresql(dot)org>
Subject: libpq: Fix lots of discrepancies in PQtrace
Date: 2024-06-21 09:22:05
Message-ID: CAGECzQSoPHtZ4xe0raJ6FYSEiPPS+YWXBhOGo+Y1YecLgknF3g@mail.gmail.com
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-hackers

After initially trying to add trace support for
StartupMessage/SSLRequest/GSSENCRequest[1] I realized there were many
more cases where PQtrace was not correctly tracing messages, or not
even tracing them at all. These patches fix all of the issues that I
was able to find.

0001 is some cleanup after f4b54e1ed9
0002 does some preparatory changes for 0004 & 0007

All the others improve the tracing, and apart from 0004 and 0007
depending on 0002, none of these patches depend on each other.
Although you could argue that 0007 and 0008 depend on 0006, because
without 0006 the code added by 0007 and 0008 won't ever really be
executed.

To test you can add a PQreset(conn) call to the start of the
test_cancel function in:
src/test/modules/libpq_pipeline/libpq_pipeline.c.

And then run:
ninja -C build all install-quiet &&
build/src/test/modules/libpq_pipeline/libpq_pipeline cancel
'port=5432' -t test.trace

And then look at the top of test.trace

[1]: https://www.postgresql.org/message-id/CAGECzQTTN5aGqtDaRifJXPyd_O5qHWQcOxsHJsDSVNqMugGNEA%40mail.gmail.com

Attachment Content-Type Size
v1-0001-libpq-Use-PqMsg-macros-in-fe-auth.c.patch application/x-patch 2.0 KB
v1-0002-libpq-Add-suppress-argument-to-pqTraceOutputNchar.patch application/x-patch 2.8 KB
v1-0003-libpq-Trace-StartupMessage-SSLRequest-GSSENCReque.patch application/x-patch 2.8 KB
v1-0004-libpq-Trace-frontend-authentication-challenges.patch application/x-patch 6.9 KB
v1-0005-libpq-Trace-responses-to-SSLRequest-and-GSSENCReq.patch application/x-patch 3.2 KB
v1-0006-libpq-Trace-all-messages-received-from-the-server.patch application/x-patch 8.2 KB
v1-0007-libpq-Trace-server-Authentication-messages-in-det.patch application/x-patch 3.0 KB
v1-0008-libpq-Trace-NegotiateProtocolVersion-correctly.patch application/x-patch 1.4 KB

Responses

Browse pgsql-hackers by date

  From Date Subject
Next Message Michail Nikolaev 2024-06-21 09:31:21 Re: Issues with ON CONFLICT UPDATE and REINDEX CONCURRENTLY
Previous Message jian he 2024-06-21 08:53:55 Re: minor doc issue in 9.16.2.1.1. Boolean Predicate Check Expressions