Fixing the "Error in configuration. Last filter is multi filter. Needs to be non-multi one. Stopping" error
Last week we ran into an interesting problem with our MySQL master/slave replication. During the week (when we’re working) the propagation delay from master to slave is less than a second but for some reason on Saturdays the delay jumps up for several minutes (still trying to figure this one out). This caused a problem where multiple records would try to be inserted for the same data (read fails to find the new row which causes it to assume there is a need for a new record).
To get around this issue we used the instructions on https://blog.engineyard.com/2014/advanced-read-write-splitting-with-phps-mysqlnd to switch to using the eventual_consistency filter in our mysqlnd_ms config:
After a service apache2 restart
we received the following error message:
Error while building page SQLSTATE[HY000] [2000] (mysqlnd_ms) Error in configuration. Last filter is multi filter. Needs to be non-multi one. Stopping
This is one of those horrible error messages where a Google Search returns the source code with the error in it as one of the few results.
This is what I learned while trying to debug this problem.
The filters in the mysqlnd config are either multi, which means they return multiple possible servers, or non-multi, which means then return a single value. The quality_of_service
filter is a multi filter which returns any records that are less than age
(from the config) seconds_behind_master
(from show slave
).
In order to fix this error the last filter must be a non-multi filter. In our case we added the roundrobin filter.
Hopefully, other people will find this helpful.
Scott Keck-Warren
Scott is the Director of Technology at WeCare Connect where he strives to provide solutions for his customers needs. He's the father of two and can be found most weekends working on projects around the house with his loving partner.
Top Posts
- Working With Soft Deletes in Laravel (By Example)
- Fixing CMake was unable to find a build program corresponding to "Unix Makefiles"
- Upgrading to Laravel 8.x
- Get The Count of the Number of Users in an AD Group
- Multiple Vagrant VMs in One Vagrantfile
- Fixing the "this is larger than GitHub's recommended maximum file size of 50.00 MB" error
- Changing the Directory Vagrant Stores the VMs In
- Accepting Android SDK Licenses From The OSX Command Line
- Fixing the 'Target class [config] does not exist' Error
- Using Rectangle to Manage MacOS Windows