Resolving B-Tree index sibling errors in VMware vFabric Postgres Standard Edition 9.x
search cancel

Resolving B-Tree index sibling errors in VMware vFabric Postgres Standard Edition 9.x

book

Article ID: 343136

calendar_today

Updated On:

Products

VMware

Issue/Introduction


Symptoms:
  • In the VMware vFabric Postgres logs, you see a message similar to:

    2013-06-30 23:56:28.882 UTC alivevm alive ERROR: right sibling's left-link doesn't match: block 180376 links to 990812 instead of expected 997597 in index "Indx_Date_Resource"

  • Updates or inserts into the database appear to be failing.


Environment

VMware vFabric Postgres Standard Edition 9
VMware vFabric Postgres Standard Edition 9.1.x
VMware vFabric Postgres Standard Edition 9.2.x

Cause

This issue can occur if:

  • Underlying storage is corrupted
  • An external process unrelated to Postgres overwrites part of the Postgres data files

Resolution

To rebuild the index:
  1. Log in to the server as root
  2. Locate the Postgres binaries on the server. For example:

    find / -name psql

    Note
    : In most installations, the binaries are located in /opt/vmware/vpostgres/current/bin.

  3. Stop any services or applications connecting to the database.
  4. Create a backup of the database or database cluster (all user DBs and system DBs).
    • For a single database, run a command similar to:

      sudo -u postgres /opt/vmware/vpostgres/current/bin/pg_dump mydb > /mypath/mydb.bak

    • For a database cluster, run a command similar to:

      /opt/vmware/vpostgres/current/bin/reindexdb -a -e -U postgres

Note: If the re-index is unsuccessful, you see errors indicating that it was unsuccessful. If the postgres logs are still showing index errors, you need to perform a full vacuum on the affected table with the corrupted index, then re-index the corrupted index.

To perform a full vacuum on the affected table with the corrupted index, run the command:
postgres=# vacuum full mytable;
Note: If the database has corruption on other data, the vacuum command may fail due to invalid checksums or page corruptions. For further assistance, see:


Additional Information

Resolving checksum mismatch errors in VMware vFabric Postgres (vPostgres) 9.0 / 9.1.x
vFabric Postgres fails with the error: invalid page header in block