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 :: Unread Messages :: Show Polls :: Message Navigator
| Subscribe to topic | Bookmark topic 
Return to the default flat view Create a new topic Submit Reply
MYSQL database slave support [message #164998] Wed, 13 April 2011 12:35 Go to previous message
eclipsewebmaster is currently offline  eclipsewebmaster   Canada
Messages: 46
Registered: November 2009
Location: Ottawa, Ontario, Canada
Karma:
Member
add to buddy list
ignore all messages by this user
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 471 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: Wed Dec 13 13:37:50 EST 2017

Total time taken to generate the page: 0.00976 seconds