diff --git a/src/backend/access/transam/xlog.c b/src/backend/access/transam/xlog.c
new file mode 100755
index 959f423..cd3b673
*** a/src/backend/access/transam/xlog.c
--- b/src/backend/access/transam/xlog.c
***************
*** 41,46 ****
--- 41,47 ----
  #include "postmaster/startup.h"
  #include "replication/walreceiver.h"
  #include "replication/walsender.h"
+ #include "storage/barrier.h"
  #include "storage/bufmgr.h"
  #include "storage/fd.h"
  #include "storage/ipc.h"
*************** RecoveryInProgress(void)
*** 6222,6231 ****
  		/* use volatile pointer to prevent code rearrangement */
  		volatile XLogCtlData *xlogctl = XLogCtl;
  
! 		/* spinlock is essential on machines with weak memory ordering! */
! 		SpinLockAcquire(&xlogctl->info_lck);
  		LocalRecoveryInProgress = xlogctl->SharedRecoveryInProgress;
- 		SpinLockRelease(&xlogctl->info_lck);
  
  		/*
  		 * Initialize TimeLineID and RedoRecPtr when we discover that recovery
--- 6223,6232 ----
  		/* use volatile pointer to prevent code rearrangement */
  		volatile XLogCtlData *xlogctl = XLogCtl;
  
!     /* ensure a proper read on machines with weak memory ordering! */
!     pg_read_barrier();
! 
  		LocalRecoveryInProgress = xlogctl->SharedRecoveryInProgress;
  
  		/*
  		 * Initialize TimeLineID and RedoRecPtr when we discover that recovery
