Re: tablespace_map code cleanup

From: Amit Kapila <amit(dot)kapila16(at)gmail(dot)com>
To: Robert Haas <robertmhaas(at)gmail(dot)com>
Cc: PostgreSQL Hackers <pgsql-hackers(at)lists(dot)postgresql(dot)org>
Subject: Re: tablespace_map code cleanup
Date: 2020-05-13 02:26:15
Message-ID: CAA4eK1KkALqK=-pVBDuVJdnHM88-_AUh2np-CG0ZffoqgOj_7A@mail.gmail.com
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-hackers

On Wed, May 13, 2020 at 1:54 AM Robert Haas <robertmhaas(at)gmail(dot)com> wrote:
>
> On Tue, May 12, 2020 at 2:23 AM Amit Kapila <amit(dot)kapila16(at)gmail(dot)com> wrote:
> > While looking at this, I noticed that caller (perform_base_backup) of
> > do_pg_start_backup, sets the backup phase as
> > PROGRESS_BASEBACKUP_PHASE_WAIT_CHECKPOINT whereas, in
> > do_pg_start_backup, we do collect the information about all
> > tablespaces after the checkpoint. I am not sure if it is long enough
> > that we consider having a separate phase for it. Without your patch,
> > it was covered under PROGRESS_BASEBACKUP_PHASE_ESTIMATE_BACKUP_SIZE
> > phase which doesn't appear to be a bad idea.
>
> Maybe I'm confused here, but I think the size estimation still *is*
> covered under PROGRESS_BASEBACKUP_PHASE_ESTIMATE_BACKUP_SIZE. It's
> just that now that happens a bit later.
>

There is no problem with this part.

> I'm assuming that listing the
> tablespaces is pretty cheap, but sizing them is expensive, as you'd
> have to iterate over all the files and stat() each one.
>

I was trying to say that tablespace listing will happen under
PROGRESS_BASEBACKUP_PHASE_WAIT_CHECKPOINT phase which could be a
problem if it is a costly operation but as you said it is pretty cheap
so I think we don't need to bother about that.

Apart from the above point which I think we don't need to bother, both
your patches look good to me.

--
With Regards,
Amit Kapila.
EnterpriseDB: http://www.enterprisedb.com

In response to

Responses

Browse pgsql-hackers by date

  From Date Subject
Next Message Kyotaro Horiguchi 2020-05-13 02:26:49 Re: Inefficiency in SLRU stats collection
Previous Message Mark Dilger 2020-05-13 02:07:46 Re: new heapcheck contrib module