mirror of
https://github.com/postgres/postgres.git
synced 2025-08-21 10:42:50 +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:
@@ -571,6 +571,8 @@ entryExecPlaceToPage(GinBtree btree, Buffer buf, GinBtreeStack *stack,
|
||||
elog(ERROR, "failed to add item to index page in \"%s\"",
|
||||
RelationGetRelationName(btree->index));
|
||||
|
||||
MarkBufferDirty(buf);
|
||||
|
||||
if (RelationNeedsWAL(btree->index) && !btree->isBuild)
|
||||
{
|
||||
/*
|
||||
@@ -583,6 +585,7 @@ entryExecPlaceToPage(GinBtree btree, Buffer buf, GinBtreeStack *stack,
|
||||
data.isDelete = insertData->isDelete;
|
||||
data.offset = off;
|
||||
|
||||
XLogRegisterBuffer(0, buf, REGBUF_STANDARD);
|
||||
XLogRegisterBufData(0, (char *) &data,
|
||||
offsetof(ginxlogInsertEntry, tuple));
|
||||
XLogRegisterBufData(0, (char *) insertData->entry,
|
||||
|
Reference in New Issue
Block a user