[DGD] Continuous muds

E. Harte harte at xs4all.nl
Thu Apr 16 10:33:07 CEST 1998


Hi all,

For quite some time I'd been wanting to go 100%-continuous with my mud,
but unfortunately I'm the kind of guy that sees problems no matter what
option he picks.

Disabling save_object(), write_file() and such like Dworkin would do 
seemed to be a little bit too drastic, so I didn't want to go for that.

My second thought then was to create a VFS (a Virtual FileSystem) that
would be stored in objects (ideally about one per directory, but I never
actually tried it so I don't know how feasable that would've been).
However, the massive increase in swapdevice usage was more than I found
acceptable at the time.

So, then a third option came to mind: Rollback-information.

You see, I could have said: Fine, I'll make a statedump every 15 minutes
and whenever we crash (or more accurately: when our host crashes, haven't
seen a DGD crash in quite some time) we'll just restart from the most
recent version.

However, that could (and most likely would) be causing a lot of
inconsistencies as players and wizards had been active in the minutes
between that last statedump and the actual 'crash', and that was
unacceptable to me.

By storing rollback-info I would be able to minimize the chances of
creating such inconsistencies.

Effectively I've changed the following:

 * In the auto-object I've added various checks for these efuns/kfuns:
   - save_object()
   - write_file()
     Check if the file exists before the action, if so, make a backup copy
     which you can restore afterwards, if not, make a log that it should
     be removed if we unrolling the actions.

   - remove_file()
     Make a backup copy when needed.

   - remove_dir()
   - make_dir()
     Log what happens, so that you know what to restore.

 * In the driver-object a check has been added in path_write(), and the
   same things have been added for write_file() as in the auto-object, so
   that the error-logs which are created from there are unrolled as well.

There are of course some problems that you could trip over, but I won't
spoil it all and leave some fun and entertainment for yourselves to figure
out. ;-)

It was fun implementing, and perhaps this inspires some others to give
similar ideas a go and tell about it as well?

Erwin/Nino.




List config page:  http://list.imaginary.com/mailman/listinfo/dgd



More information about the DGD mailing list