mirror of
https://github.com/postgres/postgres.git
synced 2025-09-11 00:12:06 +03:00
Assert that buffers are marked dirty before XLogRegisterBuffer().
Enforce the rule from transam/README in XLogRegisterBuffer(), and update callers to follow the rule. Hash indexes sometimes register clean pages as a part of the locking protocol, so provide a REGBUF_NO_CHANGE flag to support that use. Discussion: https://postgr.es/m/c84114f8-c7f1-5b57-f85a-3adc31e1a904@iki.fi Reviewed-by: Heikki Linnakangas
This commit is contained in:
@@ -37,6 +37,7 @@
|
||||
* will be skipped) */
|
||||
#define REGBUF_KEEP_DATA 0x10 /* include data even if a full-page image
|
||||
* is taken */
|
||||
#define REGBUF_NO_CHANGE 0x20 /* intentionally register clean buffer */
|
||||
|
||||
/* prototypes for public functions in xloginsert.c: */
|
||||
extern void XLogBeginInsert(void);
|
||||
|
@@ -179,6 +179,8 @@ extern Buffer ReadBufferWithoutRelcache(RelFileLocator rlocator,
|
||||
bool permanent);
|
||||
extern void ReleaseBuffer(Buffer buffer);
|
||||
extern void UnlockReleaseBuffer(Buffer buffer);
|
||||
extern bool BufferIsExclusiveLocked(Buffer buffer);
|
||||
extern bool BufferIsDirty(Buffer buffer);
|
||||
extern void MarkBufferDirty(Buffer buffer);
|
||||
extern void IncrBufferRefCount(Buffer buffer);
|
||||
extern void CheckBufferIsPinnedOnce(Buffer buffer);
|
||||
|
Reference in New Issue
Block a user