Re: Add contrib/pg_logicalsnapinspect

Andres Freund <andres@anarazel.de>

From: Andres Freund <andres@anarazel.de>
To: Masahiko Sawada <sawada.mshk@gmail.com>
Cc: Bertrand Drouvot <bertranddrouvot.pg@gmail.com>, Peter Smith <smithpb2250@gmail.com>, Peter Eisentraut <peter@eisentraut.org>, shveta malik <shveta.malik@gmail.com>, Amit Kapila <amit.kapila16@gmail.com>, Bharath Rupireddy <bharath.rupireddyforpostgres@gmail.com>, pgsql-hackers@lists.postgresql.org
Date: 2025-03-04T21:56:22Z
Lists: pgsql-hackers

Commits

Same data as JSON: GET /api/v1/messages/:b64id/commits the thread's linked commits as JSON, with link sources. API reference →
  1. Fix indentation issue

  2. pg_logicalinspect: Stabilize isolation tests.

  3. Add contrib/pg_logicalinspect.

  4. Move SnapBuild and SnapBuildOnDisk structs to snapshot_internal.h.

Hi,

On 2024-10-14 18:08:10 -0700, Masahiko Sawada wrote:
> I fixed a compiler warning by -Wtypedef-redefinition related to the
> declaration of SnapBuild struct, then pushed both patches.

This just failed on skink (valgrind buildfarm animal):
https://buildfarm.postgresql.org/cgi-bin/show_log.pl?nm=skink&dt=2025-03-04%2017%3A35%3A01

In the last months (not sure quite how long) only the main regression tests
were running under valgrind. I fixed that, and in one of the runs since then
the above regression failure was triggered.

diff -U3 /home/bf/bf-build/skink-master/HEAD/pgsql/contrib/pg_logicalinspect/expected/logical_inspect.out /home/bf/bf-build/skink-master/HEAD/pgsql.build/testrun/pg_logicalinspect/isolation/results/logical_inspect.out
--- /home/bf/bf-build/skink-master/HEAD/pgsql/contrib/pg_logicalinspect/expected/logical_inspect.out	2024-10-15 01:07:04.632684683 +0000
+++ /home/bf/bf-build/skink-master/HEAD/pgsql.build/testrun/pg_logicalinspect/isolation/results/logical_inspect.out	2025-03-04 18:49:34.659306138 +0000
@@ -42,11 +42,12 @@
 ----------+---------------+----------------------+---------------+----------------------
 consistent|              0|                      |              2|                     2
 consistent|              2|                     2|              0|
-(2 rows)
+consistent|              2|                     2|              0|
+(3 rows)

 step s1_get_logical_snapshot_meta: SELECT COUNT(meta.*) from pg_ls_logicalsnapdir(), pg_get_logical_snapshot_meta(name) as meta;
 count
 -----
-    2
+    3
 (1 row)

Greetings,

Andres Freund