[pgpool-hackers: 1456] Re: proposal to add set command to configure session level configuration parameters for pgpool 3.6 item#8
Tatsuo Ishii
ishii at postgresql.org
Wed Mar 9 10:51:59 JST 2016
Usama,
It looks your proposal all good and I am sure this will bring benefit
to users. Next step is, deciding which parameter can be at session
level.
Best regards,
--
Tatsuo Ishii
SRA OSS, Inc. Japan
English: http://www.sraoss.co.jp/index_en.php
Japanese:http://www.sraoss.co.jp
> Overview
> ------------
> Currently pgpool-II only supports global configuration parameters and their
> value can only be set through pgpool.conf file. This system has few
> limitations.
>
> -- Since the configuration parameter scope is global so it is not possible
> to have a changed parameter value for a particular user session.
>
> -- Changing the value of a configuration parameter is not very simple.
> Since the only way currently available is to change the parameter value in
> the configuration file and then reload it.
> Setting the value of a configuration parameter
>
> This proposal seeks a enhancements to pgpool configuration systems for
> providing
> a way to alter the value of certain configuration parameters for a user
> session. More specific the proposal is for making the pgpool configuration
> system work like GUC (Grand Unified Configuration) of PostgreSQL.
>
> Which config parameter can be changed in the session.
> --------------------------------------------
> Currently pgpool-II has two types of configuration parameters. One that can
> only be set at startup, and changing its value requires a
> pgpool-II restart. While, others are a little more flexible and can be
> changed by reloading the pgpool-II configuration file. This new
> configuration system will add another type for the configuration
> parameters, The variables belonging to that type can also be changed by
> session user and will not require pgpool-II restart. The scope of these
> variables will not be global means different sessions can have different
> values of the same variable at any time.
>
> Security
> -------------
> There will be no individual setting for each configuration parameter to
> allow or disallow it being changed for a session, and we will provide new
> boolean pgpool config parameter "*allow_set_command"* which will
> enable/disable the session level config parameters setting. And this new
> *allow_set_command *can only be changed from pgpool config file.
>
>
> Syntax
> --------------
> We will use the PostgreSQL's SET command syntax, used to alter the value of
> a PostgreSQL GUC variable.
>
> SET configuration_parameter TO value;
>
> But since this SET command is used by PostgreSQL clients to change the
> PostgreSQL's GUC so we will use "*pool_"* prefix for setting the
> pgpool-II configuration parameters.
>
> SET *pool_*configuration_parameter TO value;
>
> This pool_ prefix will only be required when changing the parameter value
> using the SET command and pgpool.conf will keep using the same existing
> configuration parameter names. For example, to change the value pgpool-II's
> *client_min_message* value we will issue the following SET command
>
> -> SET pool_client_min_message TO default;
>
> What will happen to the configuration parameters changed in the session
> during reload config.
> ------------------------------------------------------------------
>
> Reload config will not change the value of variable changed by the user in
> the session, but the once the user session disconnects the variable will be
> reset to new reloaded value.
>
> Overview of what is needed to be done in the code for this task:
> ------------------------------------------------------------------
>
> -- Enhance the configuration scanner so that we do not require a
> separate if statement for each configuration parameter in the
> "pool_config.l" file. This will require a comprehensive POOL_CONFIG
> structure that will contain all the information regarding the configuration
> parameter including its context, default value and config name.
>
> -- Define a new config context in the config scanner for the variables
> which can be changed by the SET command.
>
> -- Add the mechanism to reset the configuration parameters to their
> original value after user session disconnects. So that the configuration
> parameter value changed in one user session should not affect the other
> user's session served by the same child process.
>
> -- Add new *allow_set_command *parameter as described above.
>
>
> Comments, opinions?
>
> Regards
> Muhammad Usama
More information about the pgpool-hackers
mailing list