57
Plugin configuration file (>=1.1.x)
460
Keyword
Description
Version
Please note, if a filter chain generates an empty
slave list and the PHP configuration directive
mysqlnd_ms.multi_master=0 is used, the
plugin may emit a warning.
Filter: quality_of_service
object
The quality_of_service identifies cluster nodes capable of
delivering a certain quality of service. It is a multi filter which returns
zero, one or multiple of its input servers. Thus, it must be followed
by other filters to reduce the number of candidates down to one for
statement execution.
The quality_of_service filter has been introduced in 1.2.0-
alpha. In the 1.2 series the filters focus is on the consistency aspect
of service quality. Different types of clusters offer different default
data consistencies. For example, an asynchronous MySQL replication
slave offers eventual consistency. The slave may not be able to deliver
requested data because it has not replicated the write, it may serve
stale database because its lagging behind or it may serve current
information. Often, this is acceptable. In some cases higher consistency
levels are needed for the application to work correct. In those cases,
the quality_of_service can filter out cluster nodes which cannot
deliver the necessary quality of service.
The quality_of_service filter can be replaced or created at
runtime. A successful call to mysqlnd_ms_set_qos removes
all existing qos filter entries from the filter list and installs a new
one at the very beginning. All settings that can be made through
mysqlnd_ms_set_qos can also be in the plugins configuration file.
However, use of the function is by far the most common use case.
Instead of setting session consistency and strong consistency service
levels in the plugins configuration file it is recommended to define only
masters and no slaves. Both service levels will force the use of masters
only. Using an empty slave list shortens the configuration file, thus
improving readability. The only service level for which there is a case of
defining in the plugins configuration file is the combination of eventual
consistency and maximum slave lag.
Keyword
Description
Version
eventual_consistency
Request eventual consistency. Allows the use of
all master and slave servers. Data returned may
or may not be current.
Eventual consistency accepts an optional age
parameter. If age is given the plugin considers
only slaves for reading for which MySQL
replication reports a slave lag less or equal
to age. The replication lag is measure using
SHOW SLAVE STATUS. If the plugin fails to fetch
the replication lag, the slave tested is skipped.
Implementation details and tips are given in the
quality of service concepts section.
Since 1.2.0.