Enable per policy proxy config options

This is an alternative approach to that proposed in [1]
Adds support for optional per-policy config sections
to be added in proxy-server.conf. This is highly desirable
to allow per-policy affinity options to be set for use with
duplicated EC policies [2] and composite rings [3].
Certain options found in per-policy conf sections will
override their equivalents that may be set in the
[app:proxy-server] section. Currently the options
handled that way are:
 sorting_method
 read_affinity
 write_affinity
 write_affinity_node_count
For example:
 [proxy-server:policy:0]
 sorting_method = affinity
 read_affinity = r1=100
 write_affinity = r1
 write_affinity_node_count = 1 * replicas
The corresponding attributes of the proxy-server Application
are now available from instances of an OverrideConf object
that is obtained from Application.get_policy_options(policy).
[1] Related-Change: I9104fc789ba85ab3ab5ccd34096125b482821389
[2] Related-Change: Idd155401982a2c48110c30b480966a863f6bd305
[3] Related-Change: I0d8928b55020592f8e75321d1f7678688301d797
Co-Authored-By: Kota Tsuyuzaki <tsuyuzaki.kota@lab.ntt.co.jp>
Change-Id: I3f718f425f525baa80045ba067950c752bcaaefc
This commit is contained in:
Alistair Coles
2017年03月21日 18:53:13 +00:00
parent f02ec4de81
commit 45884c1102

View File

@@ -1751,7 +1751,9 @@ sorting_method shuffle Storage nodes can be chosen at
control. In both the timing and
affinity cases, equally-sorting nodes
are still randomly chosen to spread
load.
load. This option may be overridden
in a per-policy configuration
section.
timing_expiry 300 If the "timing" sorting_method is
used, the timings will only be valid
for the number of seconds configured
@@ -1809,14 +1811,18 @@ read_affinity None Specifies which backend servers t
be given to the selection; lower
numbers are higher priority.
Default is empty, meaning no
preference.
preference. This option may be
overridden in a per-policy
configuration section.
write_affinity None Specifies which backend servers to
prefer on writes. Format is a comma
separated list of affinity
descriptors of the form r<N> for
region N or r<N>z<M> for region N,
zone M. Default is empty, meaning no
preference.
preference. This option may be
overridden in a per-policy
configuration section.
write_affinity_node_count 2 * replicas The number of local (as governed by
the write_affinity setting) nodes to
attempt to contact first on writes,
@@ -1825,9 +1831,99 @@ write_affinity_node_count 2 * replicas The number of local (as governed
'* replicas' at the end to have it
use the number given times the number
of replicas for the ring being used
for the request.
for the request. This option may be
overridden in a per-policy
configuration section.
============================ =============== =====================================
Per policy configuration
^^^^^^^^^^^^^^^^^^^^^^^^
Some proxy-server configuration options may be overridden on a per-policy
basis by including per-policy config section(s). These options are:
- sorting_method
- read_affinity
- write_affinity
- write_affinity_node_count
The per-policy config section name must be of the form::
[proxy-server:policy:<policy index>]
.. note::
The per-policy config section name should refer to the policy index, not
the policy name.
.. note::
The first part of proxy-server config section name must match the name of
the proxy-server config section. This is typically ``proxy-server`` as
shown above, but if different then the names of any per-policy config
sections must be changed accordingly.
The value of an option specified in a per-policy section will override any
value given in the proxy-server section for that policy only. Otherwise the
value of these options will be that specified in the proxy-server section.
For example, the following section provides policy-specific options for a
policy with index 3::
[proxy-server:policy:3]
sorting_method = affinity
read_affinity = r2=1
write_affinity = r2
write_affinity_node_count = 1 * replicas
.. note::
It is recommended that per-policy config options are *not* included in the
``[DEFAULT]`` section. If they are then the following behavior applies.
Per-policy config sections will inherit options in the DEFAULT section of
the config file, and any such inheritance will take precedence over
inheriting options from the proxy-server config section.
Per-policy config section options will override options in the
``[DEFAULT]`` section. Unlike the behavior described under `General Server
Configuration`_ for paste-deploy ``filter`` and ``app`` sections, the
``set`` keyword is not required for options to override in per-policy
config sections.
For example, given the following settings in a config file::
[DEFAULT]
sorting_method = affinity
read_affinity = r0=100
write_affinity = r0
[app:proxy-server]
use = egg:swift#proxy
# use of set keyword here overrides [DEFAULT] option
set read_affinity = r1=100
# without set keyword, [DEFAULT] option overrides in a paste-deploy section
write_affinity = r1
[proxy-server:policy:0]
sorting_method = affinity
# set keyword not required here to override [DEFAULT] option
write_affinity = r1
would result in policy with index ``0`` having settings:
* ``read_affinity = r0=100`` (inherited from the ``[DEFAULT]`` section)
* ``write_affinity = r1`` (specified in the policy 0 section)
and any other policy would have the default settings of:
* ``read_affinity = r1=100`` (set in the proxy-server section)
* ``write_affinity = r0`` (inherited from the ``[DEFAULT]`` section)
Tempauth
^^^^^^^^
[tempauth]
===================== =============================== =======================
Reference in New Issue
openstack/swift
Block a user
Blocking a user prevents them from interacting with repositories, such as opening or commenting on pull requests or issues. Learn more about blocking a user.

The note is not visible to the blocked user.