The branch, v4-21-test has been updated
       via  fdb73ecba3b provision: always use a large transaction index cache
       via  15232a62876 netcmd: Increase the transaction_index_cache_size to 
200k for schemaupgrade
      from  6dbb7b0b108 VERSION: Bump version up to Samba 4.21.5...

https://git.samba.org/?p=samba.git;a=shortlog;h=v4-21-test


- Log -----------------------------------------------------------------
commit fdb73ecba3b6914f0560fc6ef590f0d2212f77c2
Author: Douglas Bagnall <[email protected]>
Date:   Fri Jan 31 10:31:32 2025 +1300

    provision: always use a large transaction index cache
    
    A larger cache costs more per transaction, but makes a large number
    of operations within a transaction faster. We expect to be dealing
    with the latter case here, regardless of the batch_mode parameter
    and the database size. 200000 is chosen because it is also used in
    join and schemaupgrade, and should be sufficient in most cases.
    
    BUG: https://bugzilla.samba.org/show_bug.cgi?id=15795
    
    Signed-off-by: Douglas Bagnall <[email protected]>
    Reviewed-by: Andrew Bartlett <[email protected]>
    
    Autobuild-User(master): Douglas Bagnall <[email protected]>
    Autobuild-Date(master): Tue Feb  4 22:47:35 UTC 2025 on atb-devel-224
    
    (cherry picked from commit e705dbbc6765454813375fee9f6a3365b947e021)
    
    Autobuild-User(v4-21-test): Jule Anger <[email protected]>
    Autobuild-Date(v4-21-test): Thu Feb 27 12:10:52 UTC 2025 on atb-devel-224

commit 15232a628763cd534976d19fdf3bbd1076984873
Author: AndrĂ©as Leroux <[email protected]>
Date:   Thu May 2 10:29:52 2024 +0200

    netcmd: Increase the transaction_index_cache_size to 200k for schemaupgrade
    
    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 <[email protected]>
    Reviewed-by: Douglas Bagnall <[email protected]>
    Reviewed-by: Andrew Bartlett <[email protected]>
    (cherry picked from commit 5092d7f46b8491e4a2d973a00aff4d6c0e77945e)

-----------------------------------------------------------------------

Summary of changes:
 python/samba/netcmd/domain/schemaupgrade.py | 6 +++++-
 python/samba/provision/__init__.py          | 9 +++------
 2 files changed, 8 insertions(+), 7 deletions(-)


Changeset truncated at 500 lines:

diff --git a/python/samba/netcmd/domain/schemaupgrade.py 
b/python/samba/netcmd/domain/schemaupgrade.py
index ff00a771b20..33b942ca460 100644
--- a/python/samba/netcmd/domain/schemaupgrade.py
+++ b/python/samba/netcmd/domain/schemaupgrade.py
@@ -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:
diff --git a/python/samba/provision/__init__.py 
b/python/samba/provision/__init__.py
index dea50aa364e..f091ccf2f18 100644
--- a/python/samba/provision/__init__.py
+++ b/python/samba/provision/__init__.py
@@ -1299,12 +1299,9 @@ def setup_samdb(path, session_info, provision_backend, 
lp, names,
         options.append("lmdb_env_size:" + str(store_size))
     if batch_mode:
         options.append("batch_mode:1")
-    if batch_mode:
-        # Estimate the number of index records in the transaction_index_cache
-        # Numbers chosen give the prime 202481 for the default backend size,
-        # which works well for a 100,000 user database
-        cache_size = int(store_size / 42423) + 1
-        options.append("transaction_index_cache_size:" + str(cache_size))
+
+    # For bulk operations like this we use a large transaction index cache.
+    options.append("transaction_index_cache_size:200000")
 
     # Load the database, but don's load the global schema and don't connect
     # quite yet


-- 
Samba Shared Repository

Reply via email to