[PATCH] s4-drs: replmd_delete implementation

tridge at samba.org tridge at samba.org
Thu Dec 17 18:27:45 MST 2009


Hi Eduardo,

 > What should I do now? Is there other steps that I could implement on the
 > delete procedure or it's better to start a new task? Maybe create some
 > routines to test the replmd_delete function?

There is certainly plenty more to do related to handling deletions
correctly! You are also welcome to look through the DRS todo list and
pick something else, but if you want to continue to work on the delete
code then I don't think you will run out of things to do soon.

As you suggest, probably the most important thing for us next is a
some test cases. 

Even better would be tests that also exercise the recycle bin
capabilities of w2k8-r2. Do you have the R2 version of w2k8 to test
against?

I've just committed a script in source4/scripting/bin/enablerecyclebin
that makes it a bit easier to enable the recycle bin on a W2K8-R2
box. If you have w2k8-r2, then you could try the script, but remember
to take a snapshot beforehand, so you can easily switch between
windows with and without the recycle bin enabled (if you use
virtualbox 3.1, then the branched snapshots makes it easy to switch
between states like this).

I think we need some python based test scripts that delete and
un-delete objects, and check that backlinks are appropriately
preserved, and that all of the attributes are changed
appropriately. We'll then want to add these test scripts to our 'make
test', once all of the changes in the drs-linked-attribs branch are
merged into master.

To develop these tests I'd suggest you first do testing manually
(using ldbdel, ldbmodify, ldbsearch, ldbrename etc), testing against
both windows and samba. That will hopefully give you some ideas on how
to develop automated tests. Then you'd start to develop python scripts
that do the actual testing.

We also need to add code to do the regular scans for objects that need
to move between the various deletion states. First off, read carefully
through section 3.1.1.1.6 of the MS-ADTS document. That explains the
various states that deleted objects go through, and what attributes
control those states. We'll need a function that runs every N minutes
(where N is configurable) which scans for deleted objects that need to
move to the next stage. I think this should probably go in
dsdb/kcc/deleted_states.c, although you could also argue that it
should be a new task. 

The deleted_states.c code would do a subtree search under the "Deleted
Objects" container of each partition, and look for objects that:

  1) are deleted, and have passed the deleted lifetime. These need to
  be made into recycled objects

  2) are recycled and have passed the recycled lifetime. These need to
  be tombstoned

  3) are tombstoned, and have passed the tombstone lifetime. These
  need to be removed.

There are still heaps of bugs related to deletion of objects in s4,
especially in relation to linked attributes. Andrew and I will be
working on those over the next few days, but it would really help us
if you could do some testing in parallel and let us know what you
find, plus start writing some tests.

Cheers, Tridge


More information about the samba-technical mailing list