logo logo

 Back to main page

The NWNX Community Forum

 FAQFAQ   SearchSearch   MemberlistMemberlist   UsergroupsUsergroups   RegisterRegister 
 ProfileProfile   Log in to check your private messagesLog in to check your private messages   Log inLog in 
 
xp_mysql 1.09 automatic reconnect questions

 
Post new topic   Reply to topic    nwnx.org Forum Index -> Technical support
View previous topic :: View next topic  
Author Message
AcadiusLost



Joined: 15 Dec 2007
Posts: 26
Location: Charlottesville, VA

PostPosted: Thu Nov 13, 2008 3:09    Post subject: xp_mysql 1.09 automatic reconnect questions Reply with quote

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
Back to top
View user's profile Send private message Visit poster's website
Display posts from previous:   
Post new topic   Reply to topic    nwnx.org Forum Index -> Technical support All times are GMT + 2 Hours
Page 1 of 1

 
Jump to:  
You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot vote in polls in this forum


Powered by phpBB © 2001, 2005 phpBB Group