Hi Chris and all!
Ok, we are getting closer to first test deployment of our app for a few user groups and (since we may experience problems, like db corruption (heaven forbid) or simply bugs in the app causing havoc) I want to make extra sure that I have a good approach regarding backups.
Am I correct that since we now have fault tolerance I could essentially just copy the db files to get a backup of the db - even though it will not be transactionally correct? I mean - I can lose the ongoing txns, but the copy should otherwise be able to recover and work, right?
Or do I need to make a shutdown in order to make sure I get a "proper" backup?
regards, Göran
Hi Göran, the fault tolerance was designed from the ground up to handle a sudden power outage. Specifically, under the assumption that writes to the various db files could be partially completed to any point in time, but a common point in time between all files.
This is a different situation than copying on-line files because the copy could take some time, even spanning multiple flushes (which are, by default, every 5 seconds). The former is a much easier scenario to consider because, in the latter, the partially-written state of each file is from a different time than all the other files.
I certainly would not risk it. You should close the DB files before doing a backup.
I have sketched out a plan for replication where on-line backup is a nice side-effect. But that might be a while so, until then, I would definitely bring down the DB to do a backup.
- Chris
--- goran@krampe.se wrote:
Hi Chris and all!
Ok, we are getting closer to first test deployment of our app for a few user groups and (since we may experience problems, like db corruption (heaven forbid) or simply bugs in the app causing havoc) I want to make extra sure that I have a good approach regarding backups.
Am I correct that since we now have fault tolerance I could essentially just copy the db files to get a backup of the db - even though it will not be transactionally correct? I mean - I can lose the ongoing txns, but the copy should otherwise be able to recover and work, right?
Or do I need to make a shutdown in order to make sure I get a "proper" backup?
regards, Göran _______________________________________________ Magma mailing list Magma@lists.squeakfoundation.org http://lists.squeakfoundation.org/mailman/listinfo/magma
I would definitely bring down the DB to do a backup.
Actually, you shouldn't have to "bring it down"..
A more convenient way to handle this would be to implement a method on the repositoryController, #backUpTo: targetFileDirectory, that closes, copies the files via Squeak's FileStream, then reoopens, all wrapped in a requestCritical: [], of course.
So, you can keep your web up but just notify there will be a pause for however long it takes for Squeak to copy the files.
How does that sound?
Hi Chris!
Chris Muller chris@funkyobjects.org wrote:
I would definitely bring down the DB to do a backup.
Actually, you shouldn't have to "bring it down"..
A more convenient way to handle this would be to implement a method on the repositoryController, #backUpTo: targetFileDirectory, that closes, copies the files via Squeak's FileStream, then reoopens, all wrapped in a requestCritical: [], of course.
So, you can keep your web up but just notify there will be a pause for however long it takes for Squeak to copy the files.
How does that sound?
Sounds great. :) Now, our db can get quite large so the file copy should do it through a buffer.
regards, Göran
Ok Göran, TSTTCPW ended up being two short methods. Its posted on SqueakSource:
Name: Magma server-cmm.157 Author: cmm Time: 24 May 2006, 10:36:44 pm UUID: eaa93523-e407-0d4f-b7ed-a699fb5ec625 Ancestors: Magma server-cmm.154
- added MagmaRepositoryController>>#backupTo: targetFileDirectory. "Backup the repository to aFileDirectory while the repository is open. Make sure you have enough space. All database requests will wait patiently until all files are backed up and then resume automatically."
I've unit-tested it and all appears to work. It uses Squeaks built-in file-copying method (FileDirectory>>#copyFile:toFile:) which looks like a 50K buffer. Please load this one single package and make sure all is well for you. If so, I will update the map (Loader packages).
- Chris
magma@lists.squeakfoundation.org