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