Simplify the way changes to full_page_writes are logged.
Simplify the way changes to full_page_writes are logged.

It's harmless to do full page writes even when not strictly necessary, so
when turning full_page_writes on, we can set the global flag first, and then
call XLogInsert. Likewise, when turning it off, we can write the WAL record
first, and then clear the flag. This way XLogInsert doesn't need any special
handling of the XLOG_FPW_CHANGE record type. XLogInsert is complicated
enough already, so anything we can keep away from there is a good thing.

Actually I don't think the atomicity of the shared memory flag matters,
anyway, because we only write the XLOG_FPW_CHANGE at the end of recovery,
when there are no concurrent WAL insertions going on. But might as well make
it safe, in case we allow changing full_page_writes on the fly in the
future.

snaga/postgres-xl,ashwinstar/gpdb,tpostgres-projects/tPostgres,xinzweb/gpdb,ashwinstar/gpdb,50wu/gpdb,50wu/gpdb,greenplum-db/gpdb,lisakowen/gpdb,snaga/postgres-xl,zeroae/postgres-xl,50wu/gpdb,snaga/postgres-xl,ashwinstar/gpdb,oberstet/postgres-xl,xinzweb/gpdb,xinzweb/gpdb,oberstet/postgres-xl,lisakowen/gpdb,ashwinstar/gpdb,lisakowen/gpdb,postmind-net/postgres-xl,arcivanov/postgres-xl,arcivanov/postgres-xl,pavanvd/postgres-xl,zeroae/postgres-xl,ovr/postgres-xl,lisakowen/gpdb,tpostgres-projects/tPostgres,arcivanov/postgres-xl,Postgres-XL/Postgres-XL,jmcatamney/gpdb,jmcatamney/gpdb,adam8157/gpdb,zeroae/postgres-xl,postmind-net/postgres-xl,adam8157/gpdb,oberstet/postgres-xl,yazun/postgres-xl,lisakowen/gpdb,xinzweb/gpdb,50wu/gpdb,snaga/postgres-xl,greenplum-db/gpdb,jmcatamney/gpdb,kmjungersen/PostgresXL,pavanvd/postgres-xl,50wu/gpdb,xinzweb/gpdb,ashwinstar/gpdb,tpostgres-projects/tPostgres,techdragon/Postgres-XL,arcivanov/postgres-xl,ovr/postgres-xl,yazun/postgres-xl,lisakowen/gpdb,ashwinstar/gpdb,pavanvd/postgres-xl,jmcatamney/gpdb,xinzweb/gpdb,postmind-net/postgres-xl,adam8157/gpdb,oberstet/postgres-xl,yazun/postgres-xl,arcivanov/postgres-xl,greenplum-db/gpdb,adam8157/gpdb,lisakowen/gpdb,greenplum-db/gpdb,ovr/postgres-xl,pavanvd/postgres-xl,zeroae/postgres-xl,xinzweb/gpdb,zeroae/postgres-xl,techdragon/Postgres-XL,kmjungersen/PostgresXL,50wu/gpdb,kmjungersen/PostgresXL,kmjungersen/PostgresXL,jmcatamney/gpdb,arcivanov/postgres-xl,ashwinstar/gpdb,adam8157/gpdb,adam8157/gpdb,Postgres-XL/Postgres-XL,50wu/gpdb,ovr/postgres-xl,postmind-net/postgres-xl,jmcatamney/gpdb,tpostgres-projects/tPostgres,techdragon/Postgres-XL,jmcatamney/gpdb,techdragon/Postgres-XL,xinzweb/gpdb,tpostgres-projects/tPostgres,greenplum-db/gpdb,50wu/gpdb,adam8157/gpdb,greenplum-db/gpdb,Postgres-XL/Postgres-XL,lisakowen/gpdb,pavanvd/postgres-xl,adam8157/gpdb,Postgres-XL/Postgres-XL,kmjungersen/PostgresXL,ovr/postgres-xl,jmcatamney/gpdb,greenplum-db/gpdb,yazun/postgres-xl,yazun/postgres-xl,Postgres-XL/Postgres-XL,oberstet/postgres-xl,postmind-net/postgres-xl,snaga/postgres-xl,greenplum-db/gpdb,techdragon/Postgres-XL,ashwinstar/gpdb