s4-server: Open and close a transaction on sam.ldb at startup

Enterprise / Samba - Andrew Bartlett [samba.org] - 7 March 2019 04:58 EST

This fixes upgrading from 4.7 and earlier releases, and makes the DB reindexing more transparent. It should also make it easier to handle future normalisation rule changes, e.g. if we change the pack-format of integer indexes in a future release.

Without this change, the should have still handled reindexing the database. We don't know why exactly this wasn't happening correctly, but opening a transaction early in the samba process startup should now guarantee that the DB is correctly reindexed by the time the main samba code runs.

An alternative fix would have been to open a transaction in the the DSDB module stack every time we connect to the database. However, this would add an extra write lock every time we open the DB, whereas starting samba happens much more infrequently.

BUG: https://bugzilla.samba.org/show_bug.cgi?id=13760

8b18da27cf2 s4-server: Open and close a transaction on sam.ldb at startup
source4/smbd/server.c | 42 ++++++++++++++++++++++++++++++++++++++++++
1 file changed, 42 insertions(+)

Upstream: gitweb.samba.org


  • Share