FUDforum
Fast Uncompromising Discussions. FUDforum will get your users talking.

Home » General » Database discussions » MYSQL database slave support (Patch included)  () 1 Vote
Show: Today's Messages :: Polls :: Message Navigator
Return to the default flat view Create a new topic Submit Reply
Re: MYSQL database slave support [message #165199 is a reply to message #165082] Mon, 09 May 2011 12:26 Go to previous messageGo to previous message
eclipsewebmaster is currently offline  eclipsewebmaster   Canada
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 1495 times)
[Message index]
 
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Previous Topic: Insert html content as a value into mysql database?
Next Topic: mssql 2012
Goto Forum:
  

-=] Back to Top [=-
[ Syndicate this forum (XML) ] [ RSS ]

Current Time: Sun May 12 10:19:59 GMT 2024

Total time taken to generate the page: 0.09434 seconds