]> git.ipfire.org Git - thirdparty/samba.git/commitdiff
netcmd: Increase the transaction_index_cache_size to 200k for schemaupgrade
authorAndréas Leroux <aleroux@tranquil.it>
Thu, 2 May 2024 08:29:52 +0000 (10:29 +0200)
committerJule Anger <janger@samba.org>
Wed, 26 Feb 2025 08:33:30 +0000 (08:33 +0000)
Increasing this value greatly improve the performances of schema
upgrade for large domains (>200k entries).

The value 200000 is chosen because it is already used in join.py, and
should be sufficient for known domains.

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

Signed-off-by: Andréas Leroux <aleroux@tranquil.it>
Reviewed-by: Douglas Bagnall <douglas.bagnall@catalyst.net.nz>
Reviewed-by: Andrew Bartlett <abartlet@samba.org>
(cherry picked from commit 5092d7f46b8491e4a2d973a00aff4d6c0e77945e)

python/samba/netcmd/domain/schemaupgrade.py

index ff00a771b20cc198b142e96746800d41a53cffdc..33b942ca460c85833c5dd3f80c95e33a5853cb70 100644 (file)
@@ -244,7 +244,11 @@ class cmd_domain_schema_upgrade(Command):
 
         temp_folder = None
 
-        samdb = SamDB(url=H, session_info=system_session(), credentials=creds, lp=lp)
+        # we set the transaction_index_cache_size to 200,000 to ensure it is
+        # not too small, if it's too small the performance of the upgrade will
+        # be negatively impacted. (similarly to the join operation)
+        samdb = SamDB(url=H, session_info=system_session(), credentials=creds, lp=lp,
+                      options=['transaction_index_cache_size:200000'])
 
         # we're not going to get far if the config doesn't allow schema updates
         if lp.get("dsdb:schema update allowed") is None: