Bug 12382 - Tombstone expunge does not remove old links
Summary: Tombstone expunge does not remove old links
Alias: None
Product: Samba 4.1 and newer
Classification: Unclassified
Component: AD: LDB/DSDB/SAMDB (show other bugs)
Version: 4.5.0
Hardware: All All
: P5 normal (vote)
Target Milestone: ---
Assignee: Andrew Bartlett
QA Contact: Samba QA Contact
Depends on:
Blocks: 12297
  Show dependency treegraph
Reported: 2016-10-18 03:13 UTC by Garming Sam
Modified: 2016-11-03 17:42 UTC (History)
3 users (show)

See Also:

Patch for 4.5 (192.89 KB, patch)
2016-10-18 03:27 UTC, Garming Sam
no flags Details
Patch for 4.5 (191.58 KB, patch)
2016-10-18 03:28 UTC, Garming Sam
no flags Details
Patch for 4.5 (190.51 KB, patch)
2016-10-18 03:34 UTC, Garming Sam
abartlet: review+

Note You need to log in before you can comment on or make changes to this bug.
Description Garming Sam 2016-10-18 03:13:47 UTC
The regular process for removing tombstoned objects after 6 months should also remove links that have been deleted for more than 6 months.
Comment 1 Garming Sam 2016-10-18 03:27:25 UTC
Created attachment 12587 [details]
Patch for 4.5
Comment 2 Garming Sam 2016-10-18 03:28:37 UTC
Created attachment 12588 [details]
Patch for 4.5
Comment 3 Garming Sam 2016-10-18 03:34:17 UTC
Created attachment 12589 [details]
Patch for 4.5
Comment 4 Andrew Bartlett 2016-10-18 03:46:11 UTC
Comment on attachment 12589 [details]
Patch for 4.5

This looks good.

Normally, what we have here would rightly be regarded as a feature, and so not be applicable for a backport.

However, this bug blocks a dbcheck bug that would require much the same changes, so instead of trying to make dbcheck cope with this also, we propose this set of tested and useful changes. 

The idea is that users should run 'samba-tool domain tombstones expunge' prior to dbcheck, and so avoid the issues with 'not fixing dangling forward link'.
Comment 5 Andrew Bartlett 2016-10-18 09:44:52 UTC
Please apply these patches to 4.5.next
Comment 6 Karolin Seeger 2016-10-19 08:01:20 UTC
(In reply to Andrew Bartlett from comment #5)
Pushed to autobuild-v4-5-test.
Comment 7 Karolin Seeger 2016-10-24 09:30:32 UTC
(In reply to Karolin Seeger from comment #6)
Pushed to v4-5-test.
Closing out bug report.

Comment 8 Kinglok, Fong 2016-11-03 10:16:39 UTC
When I try to execute:
samba-tool domain tombstones expunge

I encounter the error:
ERROR(<type 'exceptions.AttributeError'>): uncaught exception - 'module' object has no attribute 'time'
  File "/usr/local/samba/lib/python2.7/site-packages/samba/netcmd/__init__.py", line 176, in _run
    return self.run(*args, **kwargs)
  File "/usr/local/samba/lib/python2.7/site-packages/samba/netcmd/domain.py", line 3791, in run
    current_time = long(time.time())

That is also described in the thread:
As suggested on https://lists.samba.org/archive/samba/2016-October/204228.html

Therefore, please re-open the bug so that it can be tracked.
Comment 9 Andrew Bartlett 2016-11-03 17:42:23 UTC
The conflict with time.py is due to running 'make install' over an existing install that has a time.py or time.pyc in samba/netcmd/ in the install tree.

This isn't a bug in this patch, just the result of not cleaning old files away during the re-install.