Re: [HACKERS] Broken O(n^2) avoidance in wal segment recycling.

From: Andres Freund <andres(at)anarazel(dot)de>
To: Michael Paquier <michael(dot)paquier(at)gmail(dot)com>
Cc: Heikki Linnakangas <hlinnaka(at)iki(dot)fi>, PostgreSQL mailing lists <pgsql-hackers(at)postgresql(dot)org>
Subject: Re: [HACKERS] Broken O(n^2) avoidance in wal segment recycling.
Date: 2019-05-07 02:45:05
Message-ID: 20190507024505.w53vdqywbq52jxp2@alap3.anarazel.de
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-hackers

Hi,

I just hit this bad a couple times during some testing. Under load, with
2500 segments to recycle, it took well over a minute.

I think we ought to backpatch a version of this fix. Yes, there've not
been many complaints, but there's no messages during log levels one can
enable without beeing completely flooded, so I don't think it's every
likely to be debugged on a live system.

Noteworth is that this stall due to the O(n^2) happens while holding
ControlFileLock.

I'm inclined to think we should even backpatch this.

Heikki, Michael, any comment?

- Andres

In response to

Responses

Browse pgsql-hackers by date

  From Date Subject
Next Message Tom Lane 2019-05-07 02:54:43 Re: [HACKERS] Broken O(n^2) avoidance in wal segment recycling.
Previous Message David Fetter 2019-05-07 02:42:42 Re: [PATCH v1] Add a way to supply stdin to TAP tests