-
Notifications
You must be signed in to change notification settings - Fork 69
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Fix redis failback on multisite #74
Fix redis failback on multisite #74
Conversation
I think this makes sense, but why did you refactor so much code? |
I tried to do it in logical commits to make it clear, but basically, it would have created a big mess to check for multisite and then change the query to match in every place it needed to happen. It makes sense to move them to their own separate methods, though you could argue that it could be done in one method if desired. |
Looks like travis failed, but tests appear to work fine for me locally: http://d.pr/1iDZ8 |
Look at the failing test. You need to run the tests locally against multisite in order to replicate the failure. |
I think it makes more sense to do with a smaller changeset, because we don't gain much by refactoring. #75 |
Agree to disagree. ;) Thanks for #75. |
To boil it down a bit, when running a site network, we can't rely on a query like:
Because that will be routed to a site-specific location and the setting is network-wide? Also, not sure I understand this statement:
The try block is attempting to run a command against Redis. If it failed that's because the command failed. If calling |
There is that, but the main issue is that
I think I confused the issue. The point I was making there is the same point... Because |
In https://github.com/pantheon-systems/wp-redis/blob/master/object-cache.php#L1042-L1043:
The problem with this logic is that, on multisite, the
flushAll
will never be called, even though it is needed (because the try block failed for any number of reasons). This pretty much defeats the purpose of the failback logic, if we're on multisite.My suggestion is to instead, use
$wpdb->sitemeta
(and the correct columns for that table) if on multisite, so that theflushAll
will still be called on multisite, if it is needed.Possibly related: #72