pg.ddx.io  pgsql-hackers@postgresql.org mailing list archive  
help / color / mirror / Atom feed
From: Andres Freund <andres@anarazel.de>
To: pgsql-hackers@postgresql.org, Teodor Sigaev <teodor@sigaev.ru>
To: Anastasia Lubennikova <a.lubennikova@postgrespro.ru>
Subject: gist microvacuum doesn't appear to care about hot standby?
Date: Wed, 12 Dec 2018 14:45:24 -0800
Message-ID: <20181212224524.scafnlyjindmrbe6@alap3.anarazel.de> (raw)

Hi,

Am I missing something or did

commit 013ebc0a7b7ea9c1b1ab7a3d4dd75ea121ea8ba7
Author: Teodor Sigaev <teodor@sigaev.ru>
Date:   2015-09-09 18:43:37 +0300

    Microvacuum for GIST

    Mark index tuple as dead if it's pointed by kill_prior_tuple during
    ordinary (search) scan and remove it during insert process if there is no
    enough space for new tuple to insert. This improves select performance
    because index will not return tuple marked as dead and improves insert
    performance because it reduces number of page split.

    Anastasia Lubennikova <a.lubennikova@postgrespro.ru> with
     minor editorialization by me

entirely disregard recovery conflict handling?  The index entries it
removes could very well be visible to a snapshot on the standby. That's
why the equivalent nbtree (and hash) code does:


	/*
	 * If we have any conflict processing to do, it must happen before we
	 * update the page.
	 *
	 * Btree delete records can conflict with standby queries.  You might
	 * think that vacuum records would conflict as well, but we've handled
	 * that already.  XLOG_HEAP2_CLEANUP_INFO records provide the highest xid
	 * cleaned by the vacuum of the heap and so we can resolve any conflicts
	 * just once when that arrives.  After that we know that no conflicts
	 * exist from individual btree vacuum records on that index.
	 */
	if (InHotStandby)
	{
		TransactionId latestRemovedXid = btree_xlog_delete_get_latestRemovedXid(record);
		RelFileNode rnode;

		XLogRecGetBlockTag(record, 0, &rnode, NULL, NULL);

		ResolveRecoveryConflictWithSnapshot(latestRemovedXid,
											xlrec->onCatalogTable, rnode);
	}

Is there any reason something like that isn't necessary for gist? If so,
where's that documented? If not, uh, isn't that a somewhat serious bug
in gist?

Greetings,

Andres Freund




view thread (11+ messages)  latest in thread

Message-ID: <20181212224524.scafnlyjindmrbe6@alap3.anarazel.de>
Permalink:  ../20181212224524.scafnlyjindmrbe6@alap3.anarazel.de/
Also on:    postgresql.org/message-id/20181212224524.scafnlyjindmrbe6@alap3.anarazel.de

 · 

reply

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Reply to all the recipients using the --to and --cc options:
  reply via email

  To: pgsql-hackers@postgresql.org
  Cc: andres@anarazel.de, teodor@sigaev.ru, a.lubennikova@postgrespro.ru
  Subject: Re: gist microvacuum doesn't appear to care about hot standby?
  In-Reply-To: <20181212224524.scafnlyjindmrbe6@alap3.anarazel.de>

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

This inbox is served by DDX for PostgreSQL; see mirroring instructions
for how to clone and mirror all data and code used for this inbox