Re: MYSQL database slave support [message #165199 is a reply to message #165082] |
Mon, 09 May 2011 12:26 |
eclipsewebmaster
Messages: 46 Registered: November 2009 Location: Ottawa, Ontario, Canada
Karma:
|
Member |
|
|
I finally managed to get our forum upgraded to 3.0, then 3.0.2
The slave patch works, but I was getting many messages sent to the moderation queue since a few occurrences of INSERT followed by a SELECT would occur too fast for the slave to have the data.
Attached is another patch which adds /* USE MASTER */ in many of those cases where the most up-to-data data is needed.
At this time, it works reasonably well, and we're using the master+slave setup. I will need to do a bit more work to make it more robust for sessions, since if the slave gets lagged too far behind, we get the message "FATAL ERROR: No session, cannot update status!". I suppose a session is created (on master) then re-read (from the lagged slave) and since it's not there yet, an error is thrown. If you have hints as to where to look, it would be appreciated.
In the future, we (you?) will need to remember that any read-after-write operations need to be explicitly sent to the master... although, at this point in the Forum's life, I'm guessing there won't be many new instances of this behaviour...
-
Attachment: patch.txt
(Size: 9.25KB, Downloaded 1590 times)
|
|
|