[pgpool-hackers: 192] Re: pgpool stucks in pgpool_regclass() call
Tatsuo Ishii
ishii at postgresql.org
Sun Apr 7 12:39:39 JST 2013
> Recently we have multiple reports complaining that pgpool-II stucks
> and PostgreSQL is left in parsing SELECT pgpool_regclass.
>
> Today in bug report http://www.pgpool.net/mantisbt/view.php?id=53 ,
> the reporter identified that that was a problem with user side. They
> do have pgpool_regclass() but they do *not* have execute privilege on
> the function. I know
>
> You can reproduce the problem by revoking execute privilege from a
> user something like this:
>
> createuser foo
> revoke revoke all on function pgpool_regclass(cstring) from public;
> grant execute on function pgpool_regclass(cstring) to postgres;
>
> The apparent solution is before calling pgpool_regclass(), make sure
> that the user has a privilege to execute the function. This is easy
> but will add lots of overhead. Checking the existence is managed by
> relcache module, and it is not a problem. However checking the
> privilege would be a BIG performance problem.
>
> So I lean to the idea that if calling pgpool_regclass() fails, just
> report it and exit the session.
>
> Thoughts?
After thinking more, I decided to employ this solution because we can
avoid the overhead by caching has_function_privilege() for each user.
> The apparent solution is before calling pgpool_regclass(), make sure
> that the user has a privilege to execute the function. This is easy
> but will add lots of overhead. Checking the existence is managed by
> relcache module, and it is not a problem. However checking the
> privilege would be a BIG performance problem.
Fix committed to master and all V3 branches.
--
Tatsuo Ishii
SRA OSS, Inc. Japan
English: http://www.sraoss.co.jp/index_en.php
Japanese: http://www.sraoss.co.jp
More information about the pgpool-hackers
mailing list