Change how first WAL segment on new timeline after promotion is created.
Change how first WAL segment on new timeline after promotion is created.

Two changes:

1. When copying a WAL segment from old timeline to create the first segment
on the new timeline, only copy up to the point where the timeline switch
happens, and zero-fill the rest. This avoids corner cases where we might
think that the copied WAL from the previous timeline belong to the new
timeline.

2. If the timeline switch happens at a segment boundary, don't copy the
whole old segment to the new timeline. It's pointless, because it's 100%
identical to the old segment.

jmcatamney/gpdb,ashwinstar/gpdb,zeroae/postgres-xl,zeroae/postgres-xl,lisakowen/gpdb,pavanvd/postgres-xl,50wu/gpdb,lisakowen/gpdb,jmcatamney/gpdb,lisakowen/gpdb,yazun/postgres-xl,techdragon/Postgres-XL,adam8157/gpdb,50wu/gpdb,adam8157/gpdb,50wu/gpdb,pavanvd/postgres-xl,xinzweb/gpdb,greenplum-db/gpdb,jmcatamney/gpdb,xinzweb/gpdb,50wu/gpdb,ashwinstar/gpdb,zeroae/postgres-xl,oberstet/postgres-xl,oberstet/postgres-xl,ashwinstar/gpdb,xinzweb/gpdb,zeroae/postgres-xl,pavanvd/postgres-xl,lisakowen/gpdb,adam8157/gpdb,greenplum-db/gpdb,techdragon/Postgres-XL,ashwinstar/gpdb,ashwinstar/gpdb,ovr/postgres-xl,xinzweb/gpdb,50wu/gpdb,jmcatamney/gpdb,jmcatamney/gpdb,greenplum-db/gpdb,xinzweb/gpdb,greenplum-db/gpdb,xinzweb/gpdb,adam8157/gpdb,yazun/postgres-xl,adam8157/gpdb,lisakowen/gpdb,techdragon/Postgres-XL,oberstet/postgres-xl,ovr/postgres-xl,50wu/gpdb,jmcatamney/gpdb,yazun/postgres-xl,techdragon/Postgres-XL,ovr/postgres-xl,Postgres-XL/Postgres-XL,yazun/postgres-xl,ovr/postgres-xl,jmcatamney/gpdb,Postgres-XL/Postgres-XL,greenplum-db/gpdb,pavanvd/postgres-xl,techdragon/Postgres-XL,lisakowen/gpdb,Postgres-XL/Postgres-XL,yazun/postgres-xl,adam8157/gpdb,greenplum-db/gpdb,adam8157/gpdb,50wu/gpdb,jmcatamney/gpdb,oberstet/postgres-xl,adam8157/gpdb,pavanvd/postgres-xl,ovr/postgres-xl,ashwinstar/gpdb,zeroae/postgres-xl,lisakowen/gpdb,greenplum-db/gpdb,Postgres-XL/Postgres-XL,oberstet/postgres-xl,lisakowen/gpdb,xinzweb/gpdb,50wu/gpdb,ashwinstar/gpdb,Postgres-XL/Postgres-XL,ashwinstar/gpdb,xinzweb/gpdb,greenplum-db/gpdb