Re: [PATCH] Add CHECK_FOR_INTERRUPTS in scram_SaltedPassword loop.

Michael Paquier <michael@paquier.xyz>

From: Michael Paquier <michael@paquier.xyz>
To: Daniel Gustafsson <daniel@yesql.se>
Cc: Aleksander Alekseev <aleksander@timescale.com>, Postgres hackers <pgsql-hackers@lists.postgresql.org>, Bowen Shi <zxwsbg12138@gmail.com>, Tom Lane <tgl@sss.pgh.pa.us>
Date: 2023-11-27T23:39:26Z
Lists: pgsql-hackers
On Mon, Nov 27, 2023 at 10:05:49AM +0100, Daniel Gustafsson wrote:
> I don't see any reason to backpatch further down than 16 given how low the
> hardcoded value is set there, scanning the archives I see no complaints about
> it either.  As a reference, CREATE ROLE using 4096 iterations takes 14ms on my
> 10 year old laptop (1M iterations, 244x the default, takes less than a second).

Agreed, so done it this way.  \password has the same problem, where we
could perhaps do something with a callback or something like that, or
perhaps that's just not worth bothering.
--
Michael

Commits

  1. Add CHECK_FOR_INTERRUPTS() in scram_SaltedPassword() for the backend