Properly terminate the array returned by GetLockConflicts().
Properly terminate the array returned by GetLockConflicts().

GetLockConflicts() has for a long time not properly terminated the
returned array. During normal processing the returned array is zero
initialized which, while not pretty, is sufficient to be recognized as
a invalid virtual transaction id. But the HotStandby case is more than
aesthetically broken: The allocated (and reused) array is neither
zeroed upon allocation, nor reinitialized, nor terminated.

Not having a terminating element means that the end of the array will
not be recognized and that recovery conflict handling will thus read
ahead into adjacent memory. Only terminating when hitting memory
content that looks like a invalid virtual transaction id.  Luckily
this seems so far not have caused significant problems, besides making
recovery conflict more expensive.

Discussion: 20150127142713.GD29457@awork2.anarazel.de

Backpatch into all supported branches.

50wu/gpdb,50wu/gpdb,xinzweb/gpdb,jmcatamney/gpdb,adam8157/gpdb,jmcatamney/gpdb,ashwinstar/gpdb,lisakowen/gpdb,adam8157/gpdb,jmcatamney/gpdb,xinzweb/gpdb,adam8157/gpdb,adam8157/gpdb,ashwinstar/gpdb,greenplum-db/gpdb,lisakowen/gpdb,greenplum-db/gpdb,xinzweb/gpdb,50wu/gpdb,50wu/gpdb,lisakowen/gpdb,lisakowen/gpdb,greenplum-db/gpdb,xinzweb/gpdb,ashwinstar/gpdb,xinzweb/gpdb,xinzweb/gpdb,adam8157/gpdb,jmcatamney/gpdb,xinzweb/gpdb,greenplum-db/gpdb,50wu/gpdb,jmcatamney/gpdb,ashwinstar/gpdb,jmcatamney/gpdb,ashwinstar/gpdb,50wu/gpdb,adam8157/gpdb,jmcatamney/gpdb,50wu/gpdb,greenplum-db/gpdb,adam8157/gpdb,lisakowen/gpdb,50wu/gpdb,ashwinstar/gpdb,greenplum-db/gpdb,greenplum-db/gpdb,lisakowen/gpdb,lisakowen/gpdb,xinzweb/gpdb,ashwinstar/gpdb,adam8157/gpdb,jmcatamney/gpdb,greenplum-db/gpdb,ashwinstar/gpdb,lisakowen/gpdb