I wrote:
> Heikki Linnakangas <heikki@enterprisedb.com> writes:
>> Dave, would you please create a new binary with the attached patch? And
>> LOCK_DEBUG and assertions and debug enabled.
> Also, it would be worth adding "lockmode" to the set of things printed
> by the panic message in the patch I sent earlier.
Also: as long as we are building a custom-hacked executable to probe
into this, let's hack it to not remove the 2PC state file, so we can
double check what's really in there. I believe what you'd need to
remove is the RemoveTwoPhaseFile calls at twophase.c line 1583 (where
it thinks it's "stale") and xact.c line 4223 (where it's replaying a
XLOG_XACT_COMMIT_PREPARED WAL record).
regards, tom lane