Re: BUG #15182: Canceling authentication due to timeout aka Denial of Service Attack
Michael Paquier <michael@paquier.xyz>
From: Michael Paquier <michael@paquier.xyz>
To: Robert Haas <robertmhaas@gmail.com>
Cc: Jeremy Schneider <schnjere@amazon.com>, PostgreSQL-development <pgsql-hackers@postgresql.org>, "Albin, Lloyd P" <lalbin@scharp.org>
Date: 2018-07-24T04:14:03Z
Lists: pgsql-bugs, pgsql-hackers
Commits
Same data as JSON:
GET /api/v1/messages/:b64id/commits
the thread's linked commits as JSON, with link sources.
API reference →
-
Improve VACUUM and ANALYZE by avoiding early lock queue
- a556549d7e6d 12.0 landed
-
Improve TRUNCATE by avoiding early lock queue
- f841ceb26d70 12.0 landed
-
Restrict access to reindex of shared catalogs for non-privileged users
- 87330e21c327 11.0 landed
- 661dd23950f2 12.0 landed
-
Improve behavior of concurrent CLUSTER.
- cbe24a6dd8fb 9.2.0 cited
On Mon, Jul 23, 2018 at 11:29:33AM -0400, Robert Haas wrote: > ExecuteTruncate needs to be refactored to use RangeVarGetRelidExtended > with a non-NULL callback rather than heap_openrv, and > expand_vacuum_rel needs to use RangeVarGetRelidExtended with a > callback instead of RangeVarGetRelid. See > cbe24a6dd8fb224b9585f25b882d5ffdb55a0ba5 as an example of what to do. > I fixed a large number of cases of this problem back around that time, > but then ran out of steam and had to move onto other things before I > got them all. Patches welcome. Thanks for pointing those out, I looked at both code paths recently for some other work... The amount of work does not consist just in using for example RangeVarCallbackOwnsRelation for VACUUM and TRUNCATE. There are a couple of reasons behind that: - While it would make sense, at least to me, to make VACUUM fall into if allow_system_table_mods is allowed, that's not the case of ANALYZE as I think that we should be able to call ANALYZE on a system catalog as well. So we would basically a new flavor of RangeVarCallbackOwnsRelation for VACUUM which makes this difference between vacuum and analyze with an argument in the callback, the options of VacuumStmt would be nice. This would not be used by autovacuum anyway, but adding an assertion and mentioning that in the comments would not hurt. There is an argument for just restricting VACUUM FULL as well and not plain VACUUM, as that's the one hurting here. - TRUNCATE is closer to a solution, as it has its own flavor of relation checks with truncate_check_rel. So the callback would replace truncate_check_rel but CheckTableNotInUse should be moved out of it. TRUNCATE already uses allow_system_table_mods for its checks. Thoughts? -- Michael