Skip to content

Incorrect usage of GenericXLogRegisterBuffer #179

Description

@knizhnik

There are some places in RUM where GenericXLogRegisterBuffer is called for newly created by RumNewBuffer page without GENERIC_XLOG_FULL_IMAGE flag. For example rumbtree.c:543:

					rpage = GenericXLogRegisterBuffer(state, rbuffer, 0);

The problem is that RumNewBuffer doesn't initialize buffer, so it contains zeroes.
And XLogReadBufferExtended rejects new pages:

	if (mode == RBM_NORMAL)
	{
		/* check that page has been initialized */
		Page		page = (Page) BufferGetPage(buffer);

		/*
		 * We assume that PageIsNew is safe without a lock. During recovery,
		 * there should be no other backends that could modify the buffer at
		 * the same time.
		 */
		if (PageIsNew(page))
		{
			ReleaseBuffer(buffer);
			log_invalid_page(rlocator, forknum, blkno, true);
			return InvalidBuffer;
		}
	}

So in some cases recovery of RUM pages is not performed.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Fields

    No fields configured for issues without a type.

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions