Check and wait to avoid large replication lag in heap_multi_insert()
Check and wait to avoid large replication lag in heap_multi_insert()

Reviewed-by: Asim R P <24f343109504afa210657d296a0873118cbd2b97@pivotal.io>
Reviewed-by: Heikki Linnakangas <9304c20251d03f4d84fc732cc8196e9ef6638e64@pivotal.io>
Reviewed-by: Paul Guo <e78f8a884cebd97fb3b249dc32d233761d2e480a@pivotal.io>

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