Re: BUG #18828: Crash when pg_get_logical_snapshot_meta() passed empty string
Masahiko Sawada <sawada.mshk@gmail.com>
From: Masahiko Sawada <sawada.mshk@gmail.com>
To: Bertrand Drouvot <bertranddrouvot.pg@gmail.com>
Cc: Tom Lane <tgl@sss.pgh.pa.us>, tharakan@gmail.com,
pgsql-bugs@lists.postgresql.org
Date: 2025-03-04T20:11:07Z
Lists: pgsql-bugs
On Tue, Mar 4, 2025 at 2:45 AM Bertrand Drouvot
<bertranddrouvot.pg@gmail.com> wrote:
>
> Hi,
>
> On Tue, Mar 04, 2025 at 07:38:14AM +0000, Bertrand Drouvot wrote:
> > PFA 0001 a new version to also parse the ".snap".
>
> PFA v3 (a slightly different version) to "correctly" use the new report_error
> introduced in v2.
Thank you for the patch! I agree to have some regression tests for that.
Looking at the 0001 patch, it seems that the pg_logicalinspect
functions still accepts invalid filenames as follows:
postgres(1:2713976)=# select
pg_get_logical_snapshot_info('0-40796E18.foo.snap');
ERROR: could not open file "pg_logical/snapshots/0-40796E18.snap": No
such file or directory
Regarding the 0002 patch, TBH I'm confused about what the original
comment intended to mean. I thought that it means that we don't need
to use a critical section for fsync_fname() calls to promote the fsync
error. If that's right, it would be better to update the comment
instead of removing it.
Regards,
--
Masahiko Sawada
Amazon Web Services: https://aws.amazon.com
Commits
Same data as JSON:
GET /api/v1/messages/:b64id/commits
the thread's linked commits as JSON, with link sources.
API reference →
-
pg_logicalinspect: Fix possible crash when passing a directory path.
- bd65cb3cd48a 18.0 landed
-
Add contrib/pg_logicalinspect.
- 7cdfeee320e7 18.0 cited
-
Fix compiler warning on Windows.
- fe4ecd08d81c 11.0 cited