Search Postgresql Archives

Re: Race condition while creating a new partition

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



I’m creating a new partition for every second deliberately in order to faster reproduce a bug I have on the live environment. In the live environment a new partitions are being created every one day. More to that, we create new partitions in advance and this procedure is only a backup mechanisum in case of something goes wrong. Now I think that the only way to avoid errors like this is to use explicit locking, I tried advisory locks and it worked well. 

> On 17. Dec 2019, at 00:06, Michael Lewis <mlewis@xxxxxxxxxxx> wrote:
> 
> 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.







[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[Index of Archives]     [Postgresql Jobs]     [Postgresql Admin]     [Postgresql Performance]     [Linux Clusters]     [PHP Home]     [PHP on Windows]     [Kernel Newbies]     [PHP Classes]     [PHP Books]     [PHP Databases]     [Postgresql & PHP]     [Yosemite]

  Powered by Linux