I have also been seeing this warning lately, I had tried to check git log, and seems like following commit 546c13e11b29 by Simon has introduced it.
But per the commit log, this seems to be a temporary arrangement: commit 546c13e11b29a5408b9d6a6e3cca301380b47f7f Author: Simon Riggs <si...@2ndquadrant.com> Date: Sun Apr 23 22:12:01 2017 +0100 Workaround for RecoverPreparedTransactions() Force overwriteOK = true while we investigate deeper fix Proposed by Tom Lane as temporary measure, accepted by me With latest update on following thread, it seems like Simon has proposed a fix that gets rid of flag overwriteOK: http://www.postgresql-archive.org/StandbyRecoverPreparedTransactions-recovers-subtrans-links-incorrectly-td5957751.html#a5957853 Regards, Jeevan Ladhe On Tue, Apr 25, 2017 at 6:36 AM, Amit Langote <langote_amit...@lab.ntt.co.jp > wrote: > Been seeing this warning recently: > > twophase.c: In function ‘RecoverPreparedTransactions’: > twophase.c:1916:9: warning: variable ‘overwriteOK’ set but not used > [-Wunused-but-set-variable] > bool overwriteOK = false; > ^~~~~~~~~~~ > > As the message says, the value of overwriteOK is not used anywhere in > RecoverPreparedTransactions: > > bool overwriteOK = false; > > /* > * It's possible that SubTransSetParent has been set before, if > * the prepared transaction generated xid assignment records. Test > * here must match one used in AssignTransactionId(). > */ > if (InHotStandby && (hdr->nsubxacts >= PGPROC_MAX_CACHED_SUBXIDS || > XLogLogicalInfoActive())) > overwriteOK = true; > > Couldn't we get rid of it? > > Thanks, > Amit > > > > -- > Sent via pgsql-hackers mailing list (pgsql-hackers@postgresql.org) > To make changes to your subscription: > http://www.postgresql.org/mailpref/pgsql-hackers >