AcadiusLost
Joined: 15 Dec 2007 Posts: 26 Location: Charlottesville, VA
|
Posted: Thu Nov 13, 2008 3:09 Post subject: xp_mysql 1.09 automatic reconnect questions |
|
|
We've been using the xp_mysql plugin extensively for our persistent world servers, and working around the lack of a reconnect functionality by checking a known record every few minutes, and if it fails; booting all players and using xp_system to restart the server process, giving a fresh start for the connection attempt. Extended downtime on our SQL server from DNS shifts causes a load-reset-reload loop until it comes back up again, which, while confusing for the players, got the job done.
I've done some initial tests on one of our modules with the new reconnect improvements, and they seem to handle brief interruptions of connectivity with the SQL server well; however I'm not sure what happens in terms of additional queries that occur during the "reconnection" process: at first glance at least they appear to be lost completely.
With our old arrangement, we at least knew that we wouldn't lose much mission-critical data, because all the players would be kicked off shortly after any SQL disconnect. If instead the module stays up and active indefinitely while the xp_mysql plugin continues to retry the SQL server; we may end up with all sorts of unexpected exception cases ingame, and be none the wiser for the cause unless we actually check the logfile to see.
So, my questions are:
Is there a way a buffer or cache could be active for queries sent to the SQL plugin during the reconnection phase?
What happens with queries and insertions when the DB is disconnected? Do they return 0/null, or do they stall the server process while it waits on a reply?
Is there a way to tell if a query failed due to lack of DB connection from back in nwscript? (Distingushable from a query returning no records)
I can envision building a long string or an array of strings in nwscript to queue up important writes to send on to the SQL DB once it's reconnected, but it'd be troublesome to code, and still wouldn't help answer any queries that involve data that's not mirrored locally.
At the least, I'd like to be able to tell specifically if the DB is disconnected from nwscript, so I can take it into account in terms of the functionality of persistency for our servers. _________________ Technical Administrator
A Land Far Away, a Persistent World Project |
|