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
MYSQL database slave support [message #164998] Wed, 13 April 2011 16:35 Go to previous message
eclipsewebmaster is currently offline  eclipsewebmaster   Canada
Messages: 46
Registered: November 2009
Location: Ottawa, Ontario, Canada
Karma:
Member
I'm preparing to move fudforum onto our database cluster, but it currently lacks slave support.

Attached is a rough patch (Against 3.0.2) that seems to cover the most of it. I tie into FUD_OPT_4 for Use Slave Yes/no. The slave algorithm essentially sends all SELECT queries to the slave, except a) if SELECT /* USE MASTER */ is specified in the query, or b) if db_locked() since that assumes a transaction is taking place.

It would be nice to query the slave to see if it's lagged, but for Bugzilla I typically do that with a shell script and it works quite well, so I'll likely do the same here.

Note: I have not tested this with mysqli.
  • Attachment: patch.txt
    (Size: 6.90KB, Downloaded 1601 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: Fri Nov 22 00:35:19 GMT 2024

Total time taken to generate the page: 0.04504 seconds