[wp-hackers] Restructuring Category Hierarchy
Jamie Talbot
wphackers at jamietalbot.com
Thu May 10 22:13:22 GMT 2007
-----BEGIN PGP SIGNED MESSAGE-----
Hash: SHA1
Bertrand wrote:
>> Michael E. Hancock wrote:
>> In the Nested Set, following the example [1] of Adding New Nodes,
>> when the
>> server *trips* while shifting the other nodes (e.g. adding 2 to the
>> lft and
>> rgt columns), it would seem any subsequent query of the tree is going
>> to be
>> inaccurate, and any additions or deletions will not 'fix' the problem.
>> There is no recovering.
I'll do some investigating into what would happen in this situation, but it might not be as
disastrous as it seems. It would be easy to identify when an error had occurred, because we would
have two left or right values the same. And we'd be able to check which one came first because of
the ID, so it's probably recoverable. However, perhaps incrementing the left and right columns
before we insert would lead to less problems - I'll do some simulations of what happens when it
chokes halfway through both cases.
> why not manually back up the transaction in another table?
> on success, remove the backup content
> on failure, restore the content
> if all else fails, presence of backup content on the next page load
> indicates that something failed, ask user to restore?
This is susceptible to the same problems - the server could fail before or during a backup, and
could fail on a restore as well. There's no real way of getting around the fact that if you want to
*guarantee* a completed atomic multi-stage transaction, you have to use... well, a transaction.
No word from Devs yet on the viability for InnoDB, but they're concentrating on the release
candidates at the moment, so I guess we can revisit this after 2.2 is out the door.
Cheers,
Jamie.
-----BEGIN PGP SIGNATURE-----
Version: GnuPG v1.2.5 (MingW32)
Comment: Using GnuPG with Mozilla - http://enigmail.mozdev.org
iD8DBQFGQ5kCrovxfShShFARAuDIAJ9uF7CncG7ZhwUgN1IcIzhVKWwBNACeMlFr
KXywrtYUSzpgikVERDBkbWg=
=86Ja
-----END PGP SIGNATURE-----
More information about the wp-hackers
mailing list