On Tue, May 2, 2017 at 2:28 AM, Pierre Ducroquet <p.p...@pinaraf.info> wrote: > I didn't have much time to spend on that issue until today, and I found a > way to solve it that seems acceptable to me. > > The biggest drawback will be that if the backup is interrupted, previous > tablespaces already copied will stay on disk, but since that issue could > already happen, I don't think it's too much a drawback.
Yeah... Perhaps cleanup_directories_atexit() could be made smarter by registering the list of folders to cleanup when they are created. But that would be for another patch. > The patch simply delays the empty folder checking until we start reading the > tablespace tarball. The first entry of the tarball being the PG_MAJOR_CATVER > folder, that can not be found otherwise, there is no real alternative to > that. I think I like this idea. The server allows tablespaces to be created in parallel for different versions in the same path. It seems that pg_basebackup should allow the same for consistency. The current behavior is present since pg_basebackup has been introduced by the way. Perhaps Magnus has some insight to offer on this. > I will submit this patch in the current commit fest. I have not spotted any flaws in the refactored logic. bool basetablespace; + bool firstfile = 1; char *copybuf = NULL; booleans are assigned with true or false. -- Michael -- Sent via pgsql-hackers mailing list (pgsql-hackers@postgresql.org) To make changes to your subscription: http://www.postgresql.org/mailpref/pgsql-hackers