From: PG Bug reporting form <noreply@postgresql.org>
To: pgsql-bugs@lists.postgresql.org
Cc: movead.li@highgo.ca
Subject: BUG #15929: logical decoding can not write down the analyse result when the output file is touched.
Date: Sat, 27 Jul 2019 09:39:47 +0000
Message-ID: <15929-ee2973046b882ad0@postgresql.org> (raw)
The following bug has been logged on the website:
Bug reference: 15929
Logged by: movead li
Email address: movead.li@highgo.ca
PostgreSQL version: 12beta1
Operating system: centos7
Description:
I was doing some testing of logical decoding and ran into a scenario that
may be a bug. The following steps will lead to reproducing the behaviour :
1.Start a logical decoding use below command:
pg_recvlogical -d postgres --slot=test2 --create-slot
pg_recvlogical -d postgres --slot=test2 --start -f ld.log
2. When I do a DML on the database it writes down the info into ld.log
file,
so far so good.
3. Next I open the log file. “Id.log” with vi and make some arbitrary
changes
in the log file.
4. If I run a DML command now the DML info will not appear in the ld.log
file.
Refer to step 2, when I did a DML it was appearing in the log file.
5. If I do some manipulation with the log file using the OS commands below :
mv ld.log ld.log1;
cp ld.log1 ld.log;
Then the DML info will start appearing in file ld.log1.
This seems like a bug to be because the user might accidentally some data
without noticing.
I have looked at the code to debug this behaviour and find a solution
In file ‘pg_recvlogical.c’ the ‘StreamLogicalLog()’ function seem to have
a
issue with handling of DML info. It uses open() to open the file and it does
not
check the file state when writing to the file after a long wait.
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Reply to all the recipients from your mail client; the link fills in
the headers below: reply via email
Some clients, webmail especially, drop In-Reply-To and References from
a link, and the reply then starts a new thread: use the mbox below.
To: pgsql-bugs@postgresql.org
Cc: noreply@postgresql.org, movead.li@highgo.ca
Subject: Re: BUG #15929: logical decoding can not write down the analyse result when the output file is touched.
In-Reply-To: <15929-ee2973046b882ad0@postgresql.org>
References: <15929-ee2973046b882ad0@postgresql.org>
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
This inbox is served by DDX for PostgreSQL; see mirroring instructions
for how to clone and mirror all data and code used for this inbox