From: Alexey Bashtanov <bashtanov@imap.cc>
To: Condor <condor@stz-bg.com>
To: Tony Shelver <tshelver@gmail.com>
Cc: pgsql-general@lists.postgresql.org
Subject: Re: Question about index on different tablespace and rebuild it
Date: Fri, 16 Nov 2018 17:40:06 +0000
Message-ID: <6ade500f-cbe2-cb5e-8382-4b6a01ccf6df@imap.cc> (raw)
In-Reply-To: <caed03e91cbf3dd86b86298e0c6f5654@stz-bg.com>
References: <816583dfa3eb6ce411cc7c987aabc4c4@stz-bg.com>
<fb87e0758fca85200c76baabce1cdf95@stz-bg.com>
<CAG0dhZC9kjOEMHP60-nAg9ESDj4+oU=umWCnmpzWT40nFOgt4w@mail.gmail.com>
<caed03e91cbf3dd86b86298e0c6f5654@stz-bg.com>
> Yes, I know. My question is: Did the pg server will start at all if
> the NVME / table space somehow is broken and indexes is unable to be
> loaded, not how to drop an index.
> Since the Postgre server is not starting at all maybe I can try
> dropping my indexes on my pocket calculator all day long.
>
> When the data is separated, is there any other tool that can rebuild
> my indexes located on broken tablespace, having of course in mind,
> that Data in
> the index is stored separately from the table. I guess the pg server
> wont start and for that reason I try to explain and wonder if the data
> and index is separated
> probably pg devs have a way to rebuild these indexes somehow when pg
> server is offline.
>
Unfortunately it doesn't sound like something feasible to me, at least
without deep hacking of postgres itself.
To start after a crash, the server needs to apply the WAL records since
last checkpoint, and they need data files to be binary the same as
before the crash.
So the index file not only needs to be there and not too corrupted, but
should have its pages and their contents to be located physically in the
same order,
which depends on the prior history of the table updates.
Postgres manual explicitly warns that all the tablespaces need to be
preserved in order to started the server.
The only possible exclusion may be temp_tablespaces and unlogged and
temporary tables -- kind of grey zone, people do it but the manual don't
allow this trick.
See also
https://blog.2ndquadrant.com/postgresql-no-tablespaces-on-ramdisks/
Best regards,
Alexey
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 from your mail client; the link fills in
the headers below: reply via email
Some clients, webmail especially, drop In-Reply-To and References from
a link, and the reply then starts a new thread: use the mbox below.
To: pgsql-general@postgresql.org
Cc: bashtanov@imap.cc, condor@stz-bg.com, tshelver@gmail.com
Subject: Re: Question about index on different tablespace and rebuild it
In-Reply-To: <6ade500f-cbe2-cb5e-8382-4b6a01ccf6df@imap.cc>
References: <816583dfa3eb6ce411cc7c987aabc4c4@stz-bg.com> <fb87e0758fca85200c76baabce1cdf95@stz-bg.com> <CAG0dhZC9kjOEMHP60-nAg9ESDj4+oU=umWCnmpzWT40nFOgt4w@mail.gmail.com> <caed03e91cbf3dd86b86298e0c6f5654@stz-bg.com> <6ade500f-cbe2-cb5e-8382-4b6a01ccf6df@imap.cc>
* 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