Possible uninitialized use of the variables (src/backend/access/transam/twophase.c)

Ranier Vilela <ranier.vf@gmail.com>

From: Ranier Vilela <ranier.vf@gmail.com>
To: Pg Hackers <pgsql-hackers@postgresql.org>
Date: 2022-02-09T11:15:45Z
Lists: pgsql-hackers

Attachments

Hi,

Commit
https://github.com/postgres/postgres/commit/1eb6d6527aae264b3e0b9c95aa70bb7a594ad1cf,
modified
data struct TwoPhaseFileHeader and added two new fields:

XLogRecPtr origin_lsn; /* lsn of this record at origin node */
TimestampTz origin_timestamp; /* time of prepare at origin node */

I think thay forgot initialize these fields in the function StartPrepare
because,
when calling function save_state_data(&hdr, sizeof(TwoPhaseFileHeader));

I have one report about possible uninitialized usage of the variables.

Best regards,

Ranier Vilela

Commits

  1. Make origin data initialization consistent other fields in 2PC header

  2. Store 2PC GID in commit/abort WAL recs for logical decoding