volatile-ref-fixes.patch

text/x-patch

Filename: volatile-ref-fixes.patch
Type: text/x-patch
Part: 0
Message: Re: Is this non-volatile pointer access OK?

Patch

Same data as JSON: GET /api/v1/attachments/:id/patch the parsed metadata as JSON — format, series position, per-file stats; never the diff bytes. API reference →
Format: unified
File+
src/backend/access/transam/xlog.c 0 0
diff --git a/src/backend/access/transam/xlog.c b/src/backend/access/transam/xlog.c
index a7762eafcd0af2a6069a52d763e8fdbe6f65dafe..70b2e1cbeb8272b836f5b451f3c00568f4d8de16 100644
*** a/src/backend/access/transam/xlog.c
--- b/src/backend/access/transam/xlog.c
*************** RecoveryRestartPoint(const CheckPoint *c
*** 8158,8165 ****
  	 * work out the next time it wants to perform a restartpoint.
  	 */
  	SpinLockAcquire(&xlogctl->info_lck);
! 	XLogCtl->lastCheckPointRecPtr = ReadRecPtr;
! 	memcpy(&XLogCtl->lastCheckPoint, checkPoint, sizeof(CheckPoint));
  	SpinLockRelease(&xlogctl->info_lck);
  }
  
--- 8158,8165 ----
  	 * work out the next time it wants to perform a restartpoint.
  	 */
  	SpinLockAcquire(&xlogctl->info_lck);
! 	xlogctl->lastCheckPointRecPtr = ReadRecPtr;
! 	xlogctl->lastCheckPoint = *checkPoint;
  	SpinLockRelease(&xlogctl->info_lck);
  }
  
*************** CreateRestartPoint(int flags)
*** 8194,8200 ****
  	/* Get a local copy of the last safe checkpoint record. */
  	SpinLockAcquire(&xlogctl->info_lck);
  	lastCheckPointRecPtr = xlogctl->lastCheckPointRecPtr;
! 	memcpy(&lastCheckPoint, &XLogCtl->lastCheckPoint, sizeof(CheckPoint));
  	SpinLockRelease(&xlogctl->info_lck);
  
  	/*
--- 8194,8200 ----
  	/* Get a local copy of the last safe checkpoint record. */
  	SpinLockAcquire(&xlogctl->info_lck);
  	lastCheckPointRecPtr = xlogctl->lastCheckPointRecPtr;
! 	lastCheckPoint = xlogctl->lastCheckPoint;
  	SpinLockRelease(&xlogctl->info_lck);
  
  	/*