Re: Race condition while creating a new partition

From: Michael Lewis <mlewis(at)entrata(dot)com>
To: Justin <zzzzz(dot)graf(at)gmail(dot)com>
Cc: Andrei Zhidenkov <andrei(dot)zhidenkov(at)n26(dot)com>, "pgsql general (pgsql-general(at)postgresql(dot)org)" <pgsql-general(at)postgresql(dot)org>
Subject: Re: Race condition while creating a new partition
Date: 2019-12-16 23:06:31
Message-ID: CAHOFxGorW7ERZOg8ajUFLNWMsZ=dGXGg1CwSJ1Dnn-umQiKOCA@mail.gmail.com
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-general

It looks like you are creating a partition for each minute of the day (when
logs get inserted for a given minute at least). Would it be at all
reasonable to have an hourly or daily job which creates the partitions
ahead of when they are actually needed? If partitions went unused in the
recent past, you could also drop those if appropriate to your workflow. I
just wonder about doing the work just-in-time via 2+ connections vs doing
it from a single process to avoid the chance of deadlock completely.

In response to

Responses

Browse pgsql-general by date

  From Date Subject
Next Message Adrian Klaver 2019-12-17 00:39:31 Re: Experiencing error during restore - found unexpected block ID (0)
Previous Message Sar 2019-12-16 17:46:04 Experiencing error during restore - found unexpected block ID (0)