Issue 6374 - nsslapd-mdb-max-dbs autotuning doesn't work properly#6400
Merged
Conversation
vashirov
reviewed
Nov 12, 2024
| @@ -100,7 +100,7 @@ dbmdb_compute_limits(struct ldbminfo *li) | |||
| */ | |||
| if (dbmdb_count_config_entries("(objectClass=nsMappingTree)", &nbsuffixes) || | |||
| dbmdb_count_config_entries("(objectClass=nsIndex)", &nbsuffixes) || | |||
Member
There was a problem hiding this comment.
Suggested change
| dbmdb_count_config_entries("(objectClass=nsIndex)", &nbsuffixes) || | |
| dbmdb_count_config_entries("(objectClass=nsIndex)", &nbindexes) || |
tbordaz
approved these changes
Nov 12, 2024
| #define NEED_DN_NORM_SP -25 | ||
| #define NEED_DN_NORM_BT -26 | ||
|
|
||
| pthread_mutex_t import_ctx_mutex = PTHREAD_MUTEX_INITIALIZER; /* Protect agains import context destruction */ |
| pthread_mutex_lock(get_import_ctx_mutex()); | ||
| ctx = job->writer_ctx; | ||
| job->writer_ctx = NULL; | ||
| pthread_mutex_unlock(get_import_ctx_mutex()); |
Contributor
There was a problem hiding this comment.
Why not moving the unlock up to the end of the function ?
Contributor
Author
There was a problem hiding this comment.
The writer_ctx is reset in the lock, so we are sure that the other threads cannot use it and
there is no reason to block these threads longer than necessary ...
Furthermore keeping the critical section trivial avoid to have to check if there is a risk of deadlock which is not so obvious if you unlock at the end (because dbmdb_import_q_destroy performs some locking ... )
progier389
added a commit
that referenced
this pull request
Jan 29, 2025
) * Issue 6374 - nsslapd-mdb-max-dbs autotuning doesn't work properly Several issues: After restarting the server nsslapd-mdb-max-dbs may not be high enough to add a new backend because the value computation is wrong. dbscan fails to open the database if nsslapd-mdb-max-dbs has been increased. dbscan crashes when closing the database (typically when using -S) When starting the instance the nsslapd-mdb-max-dbs parameter is increased to ensure that a new backend may be added. When dse.ldif path is not specified, the db environment is now open using the INFO.mdb data instead of using the default values. synchronization between thread closure and database context destruction is hardened Issue: #6374 Reviewed by: @tbordaz , @vashirov (Thanks!) (cherry picked from commit 56cd338)
progier389
added a commit
that referenced
this pull request
Jan 29, 2025
) * Issue 6374 - nsslapd-mdb-max-dbs autotuning doesn't work properly Several issues: After restarting the server nsslapd-mdb-max-dbs may not be high enough to add a new backend because the value computation is wrong. dbscan fails to open the database if nsslapd-mdb-max-dbs has been increased. dbscan crashes when closing the database (typically when using -S) When starting the instance the nsslapd-mdb-max-dbs parameter is increased to ensure that a new backend may be added. When dse.ldif path is not specified, the db environment is now open using the INFO.mdb data instead of using the default values. synchronization between thread closure and database context destruction is hardened Issue: #6374 Reviewed by: @tbordaz , @vashirov (Thanks!) (cherry picked from commit 56cd338)
progier389
added a commit
that referenced
this pull request
Jan 29, 2025
) * Issue 6374 - nsslapd-mdb-max-dbs autotuning doesn't work properly Several issues: After restarting the server nsslapd-mdb-max-dbs may not be high enough to add a new backend because the value computation is wrong. dbscan fails to open the database if nsslapd-mdb-max-dbs has been increased. dbscan crashes when closing the database (typically when using -S) When starting the instance the nsslapd-mdb-max-dbs parameter is increased to ensure that a new backend may be added. When dse.ldif path is not specified, the db environment is now open using the INFO.mdb data instead of using the default values. synchronization between thread closure and database context destruction is hardened Issue: #6374 Reviewed by: @tbordaz , @vashirov (Thanks!) (cherry picked from commit 56cd338)
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Several issues:
because the value computation is wrong.
When starting the instance the nsslapd-mdb-max-dbs parameter is increased to ensure that a new backend may be added.
When dse.ldif path is not specified, the db environment is now open using the INFO.mdb data instead of using the default values.
synchronization between thread closure and database context destruction is hardened
Issue: #6374
Reviewed by: @tbordaz , @vashirov (Thanks!)