mirror of
https://github.com/postgres/postgres.git
synced 2025-07-27 12:41:57 +03:00
Fix hash index vs "snapshot too old" problemms
Hash indexes are not WAL-logged, and so do not maintain the LSN of index pages. Since the "snapshot too old" feature counts on detecting error conditions using the LSN of a table and all indexes on it, this makes it impossible to safely do early vacuuming on any table with a hash index, so add this to the tests for whether the xid used to vacuum a table can be adjusted based on old_snapshot_threshold. While at it, add a paragraph to the docs for old_snapshot_threshold which specifically mentions this and other aspects of the feature which may otherwise surprise users. Problem reported and patch reviewed by Amit Kapila
This commit is contained in:
@ -2077,6 +2077,19 @@ include_dir 'conf.d'
|
||||
allowed, please note that in many workloads extreme bloat or
|
||||
transaction ID wraparound may occur in much shorter time frames.
|
||||
</para>
|
||||
|
||||
<para>
|
||||
This setting does not attempt to guarantee that an error will be
|
||||
generated under any particular circumstances. In fact, if the
|
||||
correct results can be generated from (for example) a cursor which
|
||||
has materialized a result set, no error will be generated even if the
|
||||
underlying rows in the referenced table have been vacuumed away.
|
||||
Some tables cannot safely be vacuumed early, and so will not be
|
||||
affected by this setting. Examples include system catalogs and any
|
||||
table which has a hash index. For such tables this setting will
|
||||
neither reduce bloat nor create a possibility of a <literal>snapshot
|
||||
too old</> error on scanning.
|
||||
</para>
|
||||
</listitem>
|
||||
</varlistentry>
|
||||
</variablelist>
|
||||
|
Reference in New Issue
Block a user