registry: add comment explaining workflow to make store_keys safe w/o transactions
commit050869fdeeb3e616b5ff29a394ffb8eb5d6176d0
authorMichael Adam <obnox@samba.org>
Tue, 6 May 2008 08:06:34 +0000 (6 10:06 +0200)
committerMichael Adam <obnox@samba.org>
Fri, 9 May 2008 11:42:17 +0000 (9 13:42 +0200)
treebf48a63e97f15fed08a8680af3ddd907f15855e1
parentb35959afd6d64cb765bfcade02812c3232322e83
registry: add comment explaining workflow to make store_keys safe w/o transactions

/*
 * Make the store operation as safe as possible without transactions:
 *
 * (1) For each subkey removed from ctr compared with old_subkeys:
 *
 *     (a) First delete the value db entry.
 *
 *     (b) Next delete the secdesc db record.
 *
 *     (c) Then delete the subkey list entry.
 *
 * (2) Now write the list of subkeys of the parent key,
 *     deleting removed entries and adding new ones.
 *
 * (3) Finally create the subkey list entries for the added keys.
 *
 * This way if we crash half-way in between deleting the subkeys
 * and storing the parent's list of subkeys, no old data can pop up
 * out of the blue when re-adding keys later on.
 */

The workflow is going to be modified to meet this agendain the next commits.

Michael
(cherry picked from commit 55dd9bdd148fc942e15aacfe9f6b38b1a5c53158)
source/registry/reg_backend_db.c