Skip to content
Snippets Groups Projects
Select Git revision
  • benchmark-tools
  • postgres-lambda
  • master default
  • REL9_4_25
  • REL9_5_20
  • REL9_6_16
  • REL_10_11
  • REL_11_6
  • REL_12_1
  • REL_12_0
  • REL_12_RC1
  • REL_12_BETA4
  • REL9_4_24
  • REL9_5_19
  • REL9_6_15
  • REL_10_10
  • REL_11_5
  • REL_12_BETA3
  • REL9_4_23
  • REL9_5_18
  • REL9_6_14
  • REL_10_9
  • REL_11_4
23 results

postgres-lambda-diff

  • Clone with SSH
  • Clone with HTTPS
  • user avatar
    Andres Freund authored
    When reindexing individual indexes on pg_class it was possible to
    either trigger an assertion failure:
    TRAP: FailedAssertion("!(!ReindexIsProcessingIndex(((index)->rd_id)))
    
    That's because reindex_index() called SetReindexProcessing() - which
    enables an asserts ensuring no index insertions happen into the index
    - before calling RelationSetNewRelfilenode(). That not correct for
    indexes on pg_class, because RelationSetNewRelfilenode() updates the
    relevant pg_class row, which needs to update the indexes.
    
    The are two reasons this wasn't noticed earlier. Firstly the bug
    doesn't trigger when reindexing all of pg_class, as reindex_relation
    has code "hiding" all yet-to-be-reindexed indexes. Secondly, the bug
    only triggers when the the update to pg_class doesn't turn out to be a
    HOT update - otherwise there's no index insertion to trigger the
    bug. Most of the time there's enough space, making this bug hard to
    trigger.
    
    To fix, move RelationSetNewRelfilenode() to before the
    SetReindexProcessing() (and, together with some other code, to outside
    of the PG_TRY()).
    
    To make sure the error checking intended by SetReindexProcessing() is
    more robust, modify CatalogIndexInsert() to check
    ReindexIsProcessingIndex() even when the update is a HOT update.
    
    Also add a few regression tests for REINDEXing of system catalogs.
    
    The last two improvements would have prevented some of the issues
    fixed in 5c156060 from being introduced in the first place.
    
    Reported-By: Michael Paquier
    Diagnosed-By: Tom Lane and Andres Freund
    Author: Andres Freund
    Reviewed-By: Tom Lane
    Discussion: https://postgr.es/m/20190418011430.GA19133@paquier.xyz
    Backpatch: 9.4-, the bug is present in all branches
    f495b65a
    History
    PostgreSQL Database Management System
    =====================================
    
    This directory contains the source code distribution of the PostgreSQL
    database management system.
    
    PostgreSQL is an advanced object-relational database management system
    that supports an extended subset of the SQL standard, including
    transactions, foreign keys, subqueries, triggers, user-defined types
    and functions.  This distribution also contains C language bindings.
    
    PostgreSQL has many language interfaces, many of which are listed here:
    
    	https://www.postgresql.org/download
    
    See the file INSTALL for instructions on how to build and install
    PostgreSQL.  That file also lists supported operating systems and
    hardware platforms and contains information regarding any other
    software packages that are required to build or run the PostgreSQL
    system.  Copyright and license information can be found in the
    file COPYRIGHT.  A comprehensive documentation set is included in this
    distribution; it can be read as described in the installation
    instructions.
    
    The latest version of this software may be obtained at
    https://www.postgresql.org/download/.  For more information look at our
    web site located at https://www.postgresql.org/.