Massassi Forums Logo

This is the static archive of the Massassi Forums. The forums are closed indefinitely. Thanks for all the memories!

You can also download Super Old Archived Message Boards from when Massassi first started.

"View" counts are as of the day the forums were archived, and will no longer increase.

ForumsDiscussion Forum → The daily downtime "fixed"
The daily downtime "fixed"
2007-04-20, 6:40 AM #1
Well, I believe I have fixed the daily downtime issue (when the backup occurs at 12:30AM PDT).

Last night will be the last time you guys have anything to complain about on that matter. :p

In addition, I changed the backup script to delete old backups after new ones are created, so we shouldn't have any disk space issues in the near future.

Now, back to that stupid PDA theme >.>
2007-04-20, 6:52 AM #2
:awesome:
2007-04-20, 8:56 AM #3
So how did you fix it?
2007-04-20, 11:49 AM #4
cool matty = uberadmin
gbk is 50 probably

MB IS FAT
2007-04-20, 12:01 PM #5
Originally posted by Brian:
So how did you fix it?


Changed it to stop locking the tables and use a different method instead, along with not gzipping anymore.
2007-04-20, 1:08 PM #6
If the tables aren't being locked, doesn't that mean you can end up with inconsistent data?
2007-04-20, 2:29 PM #7
Originally posted by Brian:
If the tables aren't being locked, doesn't that mean you can end up with inconsistent data?


no, for the same reason you can do multiple simultaneous reads/writes on a SQL server without corruption.

Like I said in the other thread, I'm not a WEB SCIENTIST, but if mutual exclusion is done at all it'd have to be done on a row-by-row basis rather than on the entire table. I really should read up on MySQL one of these days, but in terms of multithreading this particular problem has been solved for about 30 years or so.
2007-04-20, 2:58 PM #8
Originally posted by Brian:
If the tables aren't being locked, doesn't that mean you can end up with inconsistent data?

Not if you are dumping the whole table at once. Like Jon'C says, there should be some sort of lock on it (probably something along the lines of a read/write lock).
[This message has been edited. Deal with it.]
2007-04-20, 3:09 PM #9
Not to mention the fact that updates to the database happen on a transactional basis as opposed to some kind of streaming. The database will always work before and after a transaction has completed, and by definition you're guaranteed at least that degree of atomicity on a field.

Basically what I'm trying to say is that, if a person made a post in the middle of backing up the forum db, you'd have his latest posts but his postcount from 10 seconds ago. The database won't be corrupted, but something that would require multiple queries could be off.
2007-04-20, 3:26 PM #10
Originally posted by Jon`C:
Not to mention the fact that updates to the database happen on a transactional basis as opposed to some kind of streaming. The database will always work before and after a transaction has completed, and by definition you're guaranteed at least that degree of atomicity on a field.

Basically what I'm trying to say is that, if a person made a post in the middle of backing up the forum db, you'd have his latest posts but his postcount from 10 seconds ago. The database won't be corrupted, but something that would require multiple queries could be off.


That's exactly what I'm suggesting. Putting anything into tihs vb forum happens across multiple queries, and fake "cron" jobs can happen on virtually any request. MySQL doesn't enforce anything in a transaction since by default it doesn't use a storage engine/table type that allows transactions. And most PHP developers (including the vb ones) have no idea wtf a transaction is or how to use one.
2007-04-20, 4:10 PM #11
Originally posted by Brian:
That's exactly what I'm suggesting. Putting anything into tihs vb forum happens across multiple queries, and fake "cron" jobs can happen on virtually any request. MySQL doesn't enforce anything in a transaction since by default it doesn't use a storage engine/table type that allows transactions. And most PHP developers (including the vb ones) have no idea wtf a transaction is or how to use one.


that is goddamn retarded
2007-04-20, 4:18 PM #12
The only possible corruption would be as Jon`C explained, which I would be worried about regardless of the locked tables or not.

And VB has repair functions that I would run after a restore like that anyway just for safety's sake.

The benefits far outweigh the negatives, and there's no other choice.
2007-04-20, 5:08 PM #13
Honestly, yeah, if someone is posting at the exact time the database is locked the same exact kind of corruption can happen.

Only on the live database, instead of the backup.

So this is still the lesser of two evils.
2007-04-21, 2:49 AM #14
I have a silly question.

If the Massassi backups are all on the same hard drive as the live server, what happens if the Massassi hard drive dies?
2007-04-21, 7:40 AM #15
We would all go mad and blow up the internets.
2007-04-21, 7:58 AM #16
They're periodically copied over to CMs server. Hopefully that will be a nightly occurence shortly. We've had way more problems with the db getting corrupted, hacked, or otherwise destroyed, but that is a possibility we need to keep in mind.
2007-04-21, 8:03 AM #17
Actually, I think just once a week would be a lot better. Downloading a couple GB of SQL data every night just seems, well, overkill. Especially for my server.

Right now I also have a backup of the website itself (including all the levels and crap) but I don't update that very often since... yeah, it doesn't change. :p
2007-04-21, 6:11 PM #18
Weekly offsites would probably be fine.

↑ Up to the top!