Bug 12859 - Old Samba versions don't support using recent ldb versions (>=1.1.30)
Summary: Old Samba versions don't support using recent ldb versions (>=1.1.30)
Status: RESOLVED FIXED
Alias: None
Product: Samba 4.1 and newer
Classification: Unclassified
Component: AD: LDB/DSDB/SAMDB (show other bugs)
Version: 4.6.5
Hardware: All All
: P5 normal (vote)
Target Milestone: ---
Assignee: Karolin Seeger
QA Contact: Samba QA Contact
URL: https://lists.samba.org/archive/samba...
Keywords:
Depends on:
Blocks:
 
Reported: 2017-06-23 09:01 UTC by Stefan Metzmacher
Modified: 2017-09-10 13:39 UTC (History)
3 users (show)

See Also:


Attachments
Patches for v4-6-test (5.12 KB, patch)
2017-07-02 20:26 UTC, Stefan Metzmacher
abartlet: review+
metze: review? (slow)
Details
Patches for v4-5-test (5.12 KB, patch)
2017-07-02 20:26 UTC, Stefan Metzmacher
abartlet: review+
metze: review? (slow)
Details

Note You need to log in before you can comment on or make changes to this bug.
Description Stefan Metzmacher 2017-06-23 09:01:58 UTC
On Thu, 2017-06-22 at 11:08 +0200, Stefan Metzmacher wrote:
> Am 22.06.2017 um 10:36 schrieb Andrew Bartlett:
> > 
> > Without wishing to derail this, I would note that this does change the
> > ldb module ABI (which we never promised anyway),
> 
> I already changed the commit to be ldb-1.2.0.
> 
> > and also is not
> > backwards compatible with Samba < 4.7.
> 
> Why and what to you mean exactly?
> Building Samba 4.6 with the new ldb version?

Yes.

For the list archives: If you use an old Samba (or old anything,
without a hack forcing an override) and don't rebuild, they will fail
to operate as we have a check.  If you override, then you will supply a
too short modules structure.  But you know all this.

So the answer is yes, Samba 4.6 will build fine, but then fail as
below:

> > It is likely to trigger deadlock detected "failed to upgrade hash
> > locks", LDB_ERR_BUSY on earlier Samba versions, as they came to not
> > expect locking (and the required lock ordering) to be enforced on
> > ldb_tdb.
> 
> Can you give an example commit that is missing in earlier Samba
> versions?

commit 10e7c749e7b7a4155669c6ecf97a9ac52b13110a
Author: Andrew Bartlett <abartlet at samba.org>
Date:   Wed May 31 12:22:28 2017 +1200

    dsdb: Correctly call ldb_module_done in dsdb_notification

For the 1.1.30 ldb version, the even context changes require this in
Samba (less important, only hits -M single):

commit 7259661467776a76c4fa3aabaf1ae8a3d531e506
Author: Andrew Bartlett <abartlet at samba.org>
Date:   Fri May 12 01:55:45 2017 +0200

    dsdb: Use ldb_handle_use_global_event_context for rootdse modifies
    
    The modify operations on the rootDSE turn into IRPC messages, and
these need
    to be handled on the global event context, not the per-operation
context


And this probably only fails in make test and causes noise (tried to do
transaction writes during a search):

commit 5f0e53f1b90369c649688122c0a8742352f13877
Author: Andrew Bartlett <abartlet at samba.org>
Date:   Wed May 3 22:53:14 2017 +0200

    dsdb: Do not write the @INDEXLIST or @ATTRIBUTES records during
schema refresh
    
    Instead, write it once in the module init, if required, and after a
    modify to the schema partition is detected


But this will fail in normal operation:

commit b8ba0103bf45670c31384c56d6cd63bbef760a0c
Author: Andrew Bartlett <abartlet at samba.org>
Date:   Wed May 3 22:51:30 2017 +0200

    dsdb: Take out the transaction and prepare_commit locks in the same
order
    
    We must, when starting the transaction and preparing to commit the
transaction, take
    out the locks in the same order across all the databases, otherwise
we may deadlock.

...
Comment 1 Stefan Metzmacher 2017-07-02 20:26:20 UTC
Created attachment 13337 [details]
Patches for v4-6-test
Comment 2 Stefan Metzmacher 2017-07-02 20:26:49 UTC
Created attachment 13338 [details]
Patches for v4-5-test
Comment 3 Karolin Seeger 2017-07-03 09:07:30 UTC
Pushed to autobuild-v4-{6,5}-test.
Comment 4 Karolin Seeger 2017-07-05 07:02:02 UTC
(In reply to Karolin Seeger from comment #3)
Pushed to both branches.
Closing out bug report.

Thanks!
Comment 5 Mathieu Parent 2017-09-10 13:39:05 UTC
Currently in Debian we have sss which is built against ldb (and the following binary packages depending on libldb1: python-sss, python3-sss, sssd-ad-common,
sssd-common, sssd-dbus, sssd-kcm, sssd-proxy, sssd-tools).

Is sss 1.15.3 compatible with ldb >=1.1.30, which version is?