Branch '389-ds-base-1.3.3' - ldap/servers
by Ludwig Krispenz
ldap/servers/slapd/entry.c | 2 ++
ldap/servers/slapd/entrywsi.c | 8 ++++++--
2 files changed, 8 insertions(+), 2 deletions(-)
New commits:
commit 391539ad412f3ba215c1ebebc465a1adb5b1674d
Author: Ludwig Krispenz <lkrispen(a)redhat.com>
Date: Fri Jan 9 13:28:05 2015 +0100
Ticket 47964 - v2 - Incorrect search result after replacing an empty attribute
Bug Description: when a replace operation for a nonexisting attribute is
done without providing new values the entry is stored
with incorrect meta data: an empty deleted value without
attribute deletion csn.
Fix Description: in the delete phase of the replace operation already create
the attribute to set the deletion csn. It would be created anyway
in the add part of the replace operation.
The function to calculate the required size to write the entry
needs also to be adjusted.
https://fedorahosted.org/389/ticket/47964
Reviewed by: Rich, thanks
diff --git a/ldap/servers/slapd/entry.c b/ldap/servers/slapd/entry.c
index 718d78a..203c742 100644
--- a/ldap/servers/slapd/entry.c
+++ b/ldap/servers/slapd/entry.c
@@ -1554,6 +1554,8 @@ entry2str_internal_size_attrlist( const Slapi_Attr *attrlist, int entry2str_ctrl
* We need to add the size for that.
*/
elen += 1 + LDIF_CSNPREFIX_MAXLENGTH + CSN_STRSIZE;
+ /* need also space for ";deletedattribute;deleted" */
+ elen += DELETED_ATTR_STRSIZE + DELETED_VALUE_STRSIZE;
}
}
}
diff --git a/ldap/servers/slapd/entrywsi.c b/ldap/servers/slapd/entrywsi.c
index 41afe1a..8931db1 100644
--- a/ldap/servers/slapd/entrywsi.c
+++ b/ldap/servers/slapd/entrywsi.c
@@ -680,9 +680,13 @@ entry_delete_present_values_wsi(Slapi_Entry *e, const char *type, struct berval
}
retVal = LDAP_NO_SUCH_ATTRIBUTE;
}
- if ((LDAP_MOD_REPLACE == mod_op) && replacevals && replacevals[0])
+ if ((LDAP_MOD_REPLACE == mod_op))
{
- /* Create a new attribute and set the adcsn */
+ /* Create a new attribute and set the adcsn
+ * We need to do this always to set the deletion csn
+ * The attribute would otherwise be created in the
+ * entry_add_.. function
+ */
Slapi_Attr *a = slapi_attr_new();
slapi_attr_init(a, type);
attr_set_deletion_csn(a,csn);
9 years, 2 months
Branch '389-ds-base-1.3.2' - ldap/servers
by Ludwig Krispenz
ldap/servers/slapd/entry.c | 2 ++
ldap/servers/slapd/entrywsi.c | 8 ++++++--
2 files changed, 8 insertions(+), 2 deletions(-)
New commits:
commit a37956520f3678c3975979570eb3c163da584e5f
Author: Ludwig Krispenz <lkrispen(a)redhat.com>
Date: Fri Jan 9 13:28:05 2015 +0100
Ticket 47964 - v2 - Incorrect search result after replacing an empty attribute
Bug Description: when a replace operation for a nonexisting attribute is
done without providing new values the entry is stored
with incorrect meta data: an empty deleted value without
attribute deletion csn.
Fix Description: in the delete phase of the replace operation already create
the attribute to set the deletion csn. It would be created anyway
in the add part of the replace operation.
The function to calculate the required size to write the entry
needs also to be adjusted.
https://fedorahosted.org/389/ticket/47964
Reviewed by: Rich, thanks
diff --git a/ldap/servers/slapd/entry.c b/ldap/servers/slapd/entry.c
index 0679eb7..70c7f13 100644
--- a/ldap/servers/slapd/entry.c
+++ b/ldap/servers/slapd/entry.c
@@ -1536,6 +1536,8 @@ entry2str_internal_size_attrlist( const Slapi_Attr *attrlist, int entry2str_ctrl
* We need to add the size for that.
*/
elen += 1 + LDIF_CSNPREFIX_MAXLENGTH + CSN_STRSIZE;
+ /* need also space for ";deletedattribute;deleted" */
+ elen += DELETED_ATTR_STRSIZE + DELETED_VALUE_STRSIZE;
}
}
}
diff --git a/ldap/servers/slapd/entrywsi.c b/ldap/servers/slapd/entrywsi.c
index c8055d8..be83580 100644
--- a/ldap/servers/slapd/entrywsi.c
+++ b/ldap/servers/slapd/entrywsi.c
@@ -680,9 +680,13 @@ entry_delete_present_values_wsi(Slapi_Entry *e, const char *type, struct berval
}
retVal = LDAP_NO_SUCH_ATTRIBUTE;
}
- if ((LDAP_MOD_REPLACE == mod_op) && replacevals && replacevals[0])
+ if ((LDAP_MOD_REPLACE == mod_op))
{
- /* Create a new attribute and set the adcsn */
+ /* Create a new attribute and set the adcsn
+ * We need to do this always to set the deletion csn
+ * The attribute would otherwise be created in the
+ * entry_add_.. function
+ */
Slapi_Attr *a = slapi_attr_new();
slapi_attr_init(a, type);
attr_set_deletion_csn(a,csn);
9 years, 2 months
ldap/servers
by Ludwig Krispenz
ldap/servers/slapd/entry.c | 2 ++
ldap/servers/slapd/entrywsi.c | 8 ++++++--
2 files changed, 8 insertions(+), 2 deletions(-)
New commits:
commit 3182d2e8524c319393ab37ffcf6a8aefb9b92b54
Author: Ludwig Krispenz <lkrispen(a)redhat.com>
Date: Fri Jan 9 13:28:05 2015 +0100
Ticket 47964 - v2 - Incorrect search result after replacing an empty attribute
Bug Description: when a replace operation for a nonexisting attribute is
done without providing new values the entry is stored
with incorrect meta data: an empty deleted value without
attribute deletion csn.
Fix Description: in the delete phase of the replace operation already create
the attribute to set the deletion csn. It would be created anyway
in the add part of the replace operation.
The function to calculate the required size to write the entry
needs also to be adjusted.
https://fedorahosted.org/389/ticket/47964
Reviewed by: Rich, thanks
diff --git a/ldap/servers/slapd/entry.c b/ldap/servers/slapd/entry.c
index 718d78a..203c742 100644
--- a/ldap/servers/slapd/entry.c
+++ b/ldap/servers/slapd/entry.c
@@ -1554,6 +1554,8 @@ entry2str_internal_size_attrlist( const Slapi_Attr *attrlist, int entry2str_ctrl
* We need to add the size for that.
*/
elen += 1 + LDIF_CSNPREFIX_MAXLENGTH + CSN_STRSIZE;
+ /* need also space for ";deletedattribute;deleted" */
+ elen += DELETED_ATTR_STRSIZE + DELETED_VALUE_STRSIZE;
}
}
}
diff --git a/ldap/servers/slapd/entrywsi.c b/ldap/servers/slapd/entrywsi.c
index 41afe1a..8931db1 100644
--- a/ldap/servers/slapd/entrywsi.c
+++ b/ldap/servers/slapd/entrywsi.c
@@ -680,9 +680,13 @@ entry_delete_present_values_wsi(Slapi_Entry *e, const char *type, struct berval
}
retVal = LDAP_NO_SUCH_ATTRIBUTE;
}
- if ((LDAP_MOD_REPLACE == mod_op) && replacevals && replacevals[0])
+ if ((LDAP_MOD_REPLACE == mod_op))
{
- /* Create a new attribute and set the adcsn */
+ /* Create a new attribute and set the adcsn
+ * We need to do this always to set the deletion csn
+ * The attribute would otherwise be created in the
+ * entry_add_.. function
+ */
Slapi_Attr *a = slapi_attr_new();
slapi_attr_init(a, type);
attr_set_deletion_csn(a,csn);
9 years, 2 months
Changes to 'refs/tags/passsync-win-1.1.6-1'
by Noriko Hosoi
Changes since the dawn of time:
David Boreham (17):
Merge over new code: fractional replication, wan replication and windows sync plus associated UI
Merge password sync code from Bozeman Pass
Change password sync copyright notices, merge fixes to password sync code
Fix instability in re-try and backoff mechanism
Add new NT4 LDAP Service, used by windows sync
Fix handling of group membership, fix installer GUID, fix handling of entry description
Change GUID for installer
Fix display names in pass sync to say Fedora
Fix display name to say Fedora...
Fix various bad memory free bugs
Merge fixes over
Fixes for memory leaks in ntds
Patches we apply to apache ds 0.9
Update packaging for ntds
Fix ntds installer to allow repair and removal
Memory Leak Fixes for Apache DS
Fix for #157895 : logon hours doesn't work
Nathan Kinder (22):
Copyright updates
155068 - Added license to source files
Fixed licensing typo
Fix search scope for AD password sync - 159037
170321 - Increase winsync version to 1.0.1
170328 - Fixed modify type installation so it actually updates the registry
170558 - Add certutil, pk12util and missing dlls to PassSync.msi
170558 - Add certutil, pk12util and missing dlls to PassSync.msi
170135 - Improved passsync logging facilities
170556 - Make passsync obey backoff for retries when DS is down
170816 - Don't consume password changes if modify fails
170071 - Automatically add grouptype for new groups being synchd to NT4
Initial drop of new stand-alone winsync build-system
Changed unix style line endings to DOS style for nmake makefiles
Remove carriage returns from nmake makefiles
Initial checkin of stand-alone winsync build-system
186765 - Fixed memory leaks in passsync service
186171 - Fixed memory leaks in passhook.dll
186657 - Implemented locking around passhook data file access
Related: 490048
Related: 490048
ticket 47352 - Abandon old password changes prior to syncing
Noriko Hosoi (8):
Ticket #47353 - PassSync fails to open changelog
Ticket #47357 - Update the PassSync build environment
Ticket #47357 - Update the PassSync build environment
Ticket #47351 - Passsync loops when updating password of locked user
Ticket #363 - Passsync/Winsync handles passwords with 8-th bit characters incorrectly
bump verison to 1.1.5
Bug 980432 - Password Synchronization Service cannot be upgraded
Ticket #47987 - Support TLS1.1 and newer SSL versions
Rich Megginson (12):
Resolves: bug 471408
Resolves: bug 482892
Resolves: bug 426421 245630 476095
remove internal paths ; use new improved unzip.vbs
Resolves: Bug 482892
Resolves: bug 482892
Resolves: bug 490048
rename to 389
Add support for Windows 2008, VC 9, 64-bit and 32-bit
Allow install to continue if service fails
Fix install issues on 2008 - bump version to 1.1.3
use nspr 4.8.4 and nss 3.12.6 - bump version to 1.1.4
Thomas Lackey (3):
Add makefile and component information to build the Apache DS for User Sync
Add installer icons.
Modify NTDS and PassSync to build in the 'built' directory.
unknown (4):
handle 32-bit and 64-bit ldapcsdk with different dates
Add VC runtime merge module - Add migration
Remove files on uninstall - allow install to continue if service doesn't start
Allow BRAND with spaces - remove CANDLE.EXE tracing
9 years, 2 months
passwordsync/build.bat passwordsync/passhook passwordsync/passsync passwordsync/wix usersync/build.bat usersync/wrapper
by Noriko Hosoi
passwordsync/build.bat | 6 +++---
passwordsync/passhook/passhook.mak | 2 +-
passwordsync/passsync/passsync.dsp | 2 +-
passwordsync/passsync/passsync.mak | 2 +-
passwordsync/wix/PassSync.wxs | 6 +++---
5 files changed, 9 insertions(+), 9 deletions(-)
New commits:
commit 012c6ecea3f9670217014ad0e83941eaa683042d
Author: Noriko Hosoi <nhosoi(a)redhat.com>
Date: Thu Jan 15 17:20:00 2015 -0800
Ticket #47987 - Support TLS1.1 and newer SSL versions
Description:
Adjusting PassSync to the latest libraries.
. NSPR: nspr-win-4.10.6-1
. NSS: nss-win-3.16.2.3-2
. MOZLDAP: ldap-c-sdk-win-6.0.7-7
By default, PassSync uses TLS1.1 and newer SSL versions supported
by the NSS. To force to enable SSLv3.0, an environment variable
LDAPSSL_ALLOW_OLD_SSL_VERSION has to be set with some non NULL
value in Computer | Properties | Advanced system settings |
Environment Variables | System variables, add
variable: LDAPSSL_ALLOW_OLD_SSL_VERSION
value: 1
It will allow PassSync with this patch to connect to the server
that runs only accept SSLv3.0.
[...] conn=17 SSL3 128-bit AES
Note: bumped the PassSync version to 1.1.6.
https://fedorahosted.org/389/ticket/47987
Reviewed by rmeggins(a)redhat.com (Thank you, Rich!!)
diff --git a/passwordsync/build.bat b/passwordsync/build.bat
old mode 100644
new mode 100755
index daf95b4..7aa861a
--- a/passwordsync/build.bat
+++ b/passwordsync/build.bat
@@ -50,7 +50,7 @@ set DOWNLOAD=%BITSADMIN% /wrap /transfer passsyncbuild /download /priority norma
@rem HACK HACK HACK
@rem unzip.vbs just stopped working - gives File or Folder exists
@rem which is clearly not true
-@ren so, fall back on MozillaTools
+@rem so, fall back on MozillaTools
set UZCMD=C:\mozilla-build\info-zip\unzip.exe -q
@rem set UZCMD=cscript //nologo "%CD%\unzip.vbs"
@rem set DOWNLOAD=wget --no-directories
@@ -170,7 +170,7 @@ if [%BRANDNOSPACE%] == [] (
set BRANDNOSPACE=389
)
if [%VERSION%] == [] (
- set VERSION=1.1.5
+ set VERSION=1.1.6
)
rem ======== Set Various Build Directories ========
@@ -273,7 +273,7 @@ pushd "%CD%"
rem ======== Build ========
rem ------ Set Build Paths ------
-set INCLUDE=%INCLUDE%;%LIBROOT%\ldapsdk\public\ldap;%LIBROOT%\nspr\include;%LIBROOT%\nss\include
+set INCLUDE=%INCLUDE%;%LIBROOT%\ldapsdk\include\ldap;%LIBROOT%\nspr\include\nspr;%LIBROOT%\nss\include
set LIB=%LIB%;%LIBROOT%\ldapsdk\lib;%LIBROOT%\nspr\lib;%LIBROOT%\nss\lib
rem ------ PassSync ------
diff --git a/passwordsync/passhook/passhook.mak b/passwordsync/passhook/passhook.mak
index 46ed160..318746c 100644
--- a/passwordsync/passhook/passhook.mak
+++ b/passwordsync/passhook/passhook.mak
@@ -85,7 +85,7 @@ OPT_CPPFLAGS=/MT /O2 /D "NDEBUG" $(COMMON_CPPFLAGS)
DBG_CPPFLAGS=/MTd /Gm /Zi /D "_DEBUG" /RTC1 $(COMMON_CPPFLAGS)
SYS_LIBS=kernel32.lib user32.lib gdi32.lib winspool.lib comdlg32.lib advapi32.lib shell32.lib ole32.lib oleaut32.lib uuid.lib odbc32.lib odbccp32.lib
-MOZ_LIBS=nss3.lib nssutil3.lib libplc4.lib libnspr4.lib
+MOZ_LIBS=nss3.lib nssutil3.lib plc4.lib nspr4.lib
LIBS=$(SYS_LIBS) $(MOZ_LIBS)
DEF_FILE= \
diff --git a/passwordsync/passsync/passsync.dsp b/passwordsync/passsync/passsync.dsp
index 3219da9..622687c 100644
--- a/passwordsync/passsync/passsync.dsp
+++ b/passwordsync/passsync/passsync.dsp
@@ -73,7 +73,7 @@ BSC32=bscmake.exe
# ADD BSC32 /nologo
LINK32=link.exe
# ADD BASE LINK32 kernel32.lib user32.lib gdi32.lib winspool.lib comdlg32.lib advapi32.lib shell32.lib ole32.lib oleaut32.lib uuid.lib odbc32.lib odbccp32.lib kernel32.lib user32.lib gdi32.lib winspool.lib comdlg32.lib advapi32.lib shell32.lib ole32.lib oleaut32.lib uuid.lib odbc32.lib odbccp32.lib /nologo /subsystem:console /debug /machine:I386 /pdbtype:sept
-# ADD LINK32 nss3.lib libplc4.lib libnspr4.lib nsldappr32v50.lib nsldapssl32v50.lib nsldap32v50.lib kernel32.lib user32.lib gdi32.lib winspool.lib comdlg32.lib advapi32.lib shell32.lib ole32.lib oleaut32.lib uuid.lib odbc32.lib odbccp32.lib kernel32.lib user32.lib gdi32.lib winspool.lib comdlg32.lib advapi32.lib shell32.lib ole32.lib oleaut32.lib uuid.lib odbc32.lib odbccp32.lib /nologo /subsystem:console /debug /machine:I386 /pdbtype:sept
+# ADD LINK32 nss3.lib plc4.lib nspr4.lib nsldappr32v50.lib nsldapssl32v50.lib nsldap32v50.lib kernel32.lib user32.lib gdi32.lib winspool.lib comdlg32.lib advapi32.lib shell32.lib ole32.lib oleaut32.lib uuid.lib odbc32.lib odbccp32.lib kernel32.lib user32.lib gdi32.lib winspool.lib comdlg32.lib advapi32.lib shell32.lib ole32.lib oleaut32.lib uuid.lib odbc32.lib odbccp32.lib /nologo /subsystem:console /debug /machine:I386 /pdbtype:sept
!ENDIF
diff --git a/passwordsync/passsync/passsync.mak b/passwordsync/passsync/passsync.mak
index 1a44fbd..f54c48f 100644
--- a/passwordsync/passsync/passsync.mak
+++ b/passwordsync/passsync/passsync.mak
@@ -74,7 +74,7 @@ OPT_CPPFLAGS=/MT /O2 /D "NDEBUG" $(COMMON_CPPFLAGS)
DBG_CPPFLAGS=/MTd /Gm /Zi /D "_DEBUG" /RTC1 $(COMMON_CPPFLAGS)
SYS_LIBS=kernel32.lib user32.lib gdi32.lib winspool.lib comdlg32.lib advapi32.lib shell32.lib ole32.lib oleaut32.lib uuid.lib odbc32.lib odbccp32.lib
-MOZ_LIBS=nss3.lib nssutil3.lib libplc4.lib libnspr4.lib nsldappr32v60.lib nsldapssl32v60.lib nsldap32v60.lib
+MOZ_LIBS=nss3.lib nssutil3.lib plc4.lib nspr4.lib nsldappr32v60.lib nsldapssl32v60.lib nsldap32v60.lib
LIBS=$(SYS_LIBS) $(MOZ_LIBS)
COMMON_LDFLAGS=$(MACH) /MANIFEST /nologo /subsystem:console /pdb:"$(OUTDIR)\passsync.pdb" /out:$@ dssynchmsg.res
diff --git a/passwordsync/wix/PassSync.wxs b/passwordsync/wix/PassSync.wxs
index 6200643..55b3c56 100644
--- a/passwordsync/wix/PassSync.wxs
+++ b/passwordsync/wix/PassSync.wxs
@@ -202,15 +202,15 @@
</Component>
<Component Id='NSPRLibrary' Guid='7DFF5449-F38C-4C3B-9876-E32A123F1EA5' Win64='$(var.Property_Win64)'>
- <File Id='NSPR' Name='libnspr4.dll' DiskId='1' Source='libnspr4.dll' Vital='yes' />
+ <File Id='NSPR' Name='nspr4.dll' DiskId='1' Source='nspr4.dll' Vital='yes' />
</Component>
<Component Id='NSPRpldsLibrary' Guid='50C89341-754F-4092-8307-129DB119B42E' Win64='$(var.Property_Win64)'>
- <File Id='NSPRPLDS' Name='libplds4.dll' DiskId='1' Source='libplds4.dll' Vital='yes' />
+ <File Id='NSPRPLDS' Name='plds4.dll' DiskId='1' Source='plds4.dll' Vital='yes' />
</Component>
<Component Id='NSPRplcLibrary' Guid='1B8B1D78-E2C1-4F3A-A841-C79FFE26E6E0' Win64='$(var.Property_Win64)'>
- <File Id='NSPRPLC' Name='libplc4.dll' DiskId='1' Source='libplc4.dll' Vital='yes' />
+ <File Id='NSPRPLC' Name='plc4.dll' DiskId='1' Source='plc4.dll' Vital='yes' />
</Component>
<Component Id='NSSLibrary' Guid='5E122346-6B77-456D-BCC5-76D7FA8AF258' Win64='$(var.Property_Win64)'>
diff --git a/usersync/build.bat b/usersync/build.bat
old mode 100644
new mode 100755
diff --git a/usersync/wrapper/usersync.bat b/usersync/wrapper/usersync.bat
old mode 100644
new mode 100755
9 years, 2 months
Branch '389-ds-base-1.2.11' - ldap/servers
by Noriko Hosoi
ldap/servers/slapd/back-ldbm/dblayer.c | 33 +++++++++++++++++++++--------
ldap/servers/slapd/back-ldbm/dblayer.h | 2 +
ldap/servers/slapd/back-ldbm/ldbm_config.c | 4 +--
3 files changed, 29 insertions(+), 10 deletions(-)
New commits:
commit 295cf31602797b09a3b7a7c7e8d2feb71017522b
Author: Noriko Hosoi <nhosoi(a)redhat.com>
Date: Fri Jan 9 16:50:12 2015 -0800
Ticket #47934 - nsslapd-db-locks modify not taking into account.
Description: Updating the value of nsslapd-db-locks was not detected
at the server's startup time. As suggested in
https://fedorahosted.org/389/ticket/47934#comment:1
the value is stored in the guardian file as "locks:20000" at the shut-
down time. When restarting the server, the nsslapd-db-locks value in
cn=config,cn=ldbm database,cn=plugins,cn=config is compared with the
stored value (20000, in this example) and if they don't match, the
lock table is recreated. The change is logged in the error log:
[...] - resizing max db lock count: 20000 -> 30000
https://fedorahosted.org/389/ticket/47934
Reviewed by mreynolds(a)redhat.com (Thank you, Mark!!)
(cherry picked from commit f4437defacf8812c5f95869147a99f8412dc4a07)
(cherry picked from commit dc4185ea40e1f1b8527a67a0c854fcc29b8bafe7)
(cherry picked from commit d1e4698530868532bd472c70ca8ccc4a317b4199)
(cherry picked from commit 86b728f88fe0d35f403c012166f98c3a0e69ad32)
diff --git a/ldap/servers/slapd/back-ldbm/dblayer.c b/ldap/servers/slapd/back-ldbm/dblayer.c
index fe7a617..9186adf 100644
--- a/ldap/servers/slapd/back-ldbm/dblayer.c
+++ b/ldap/servers/slapd/back-ldbm/dblayer.c
@@ -1069,6 +1069,8 @@ static void dblayer_dump_config_tracing(dblayer_private *priv)
LDAPDebug(LDAP_DEBUG_TRACE,"private import mem=%d\n",priv->dblayer_private_import_mem,0,0);
LDAPDebug(LDAP_DEBUG_TRACE,"shm_key=%ld\n",priv->dblayer_shm_key,0,0);
LDAPDebug(LDAP_DEBUG_TRACE,"lockdown=%d\n",priv->dblayer_lockdown,0,0);
+ LDAPDebug(LDAP_DEBUG_TRACE,"locks=%d\n",priv->dblayer_lock_config,0,0);
+ LDAPDebug(LDAP_DEBUG_TRACE,"previous_locks=%d\n",priv->dblayer_previous_lock_config,0,0);
LDAPDebug(LDAP_DEBUG_TRACE,"tx_max=%d\n",priv->dblayer_tx_max,0,0);
}
@@ -1597,13 +1599,24 @@ dblayer_start(struct ldbminfo *li, int dbmode)
/* Is the cache being re-sized ? (If we're just doing an archive or export,
* we don't care if the cache is being re-sized) */
- if ( (priv->dblayer_previous_cachesize || priv->dblayer_previous_ncache) &&
- ((priv->dblayer_cachesize != priv->dblayer_previous_cachesize) ||
- (priv->dblayer_ncache != priv->dblayer_previous_ncache)) &&
- !(dbmode & (DBLAYER_ARCHIVE_MODE|DBLAYER_EXPORT_MODE)) ) {
- LDAPDebug(LDAP_DEBUG_ANY,
- "I'm resizing my cache now...cache was %lu and is now %lu\n",
+ if ((priv->dblayer_previous_cachesize || priv->dblayer_previous_ncache) &&
+ (priv->dblayer_previous_lock_config) &&
+ ((priv->dblayer_cachesize != priv->dblayer_previous_cachesize) ||
+ (priv->dblayer_ncache != priv->dblayer_previous_ncache) ||
+ (priv->dblayer_lock_config != priv->dblayer_previous_lock_config)) &&
+ !(dbmode & (DBLAYER_ARCHIVE_MODE|DBLAYER_EXPORT_MODE)) ) {
+ if (priv->dblayer_cachesize != priv->dblayer_previous_cachesize) {
+ LDAPDebug(LDAP_DEBUG_ANY, "resizing db cache size: %lu -> %lu\n",
priv->dblayer_previous_cachesize, priv->dblayer_cachesize, 0);
+ }
+ if (priv->dblayer_ncache != priv->dblayer_previous_ncache) {
+ LDAPDebug(LDAP_DEBUG_ANY, "resizing db cache count: %d -> %d\n",
+ priv->dblayer_previous_ncache, priv->dblayer_ncache, 0);
+ }
+ if (priv->dblayer_lock_config != priv->dblayer_previous_lock_config) {
+ LDAPDebug(LDAP_DEBUG_ANY, "resizing max db lock count: %d -> %d\n",
+ priv->dblayer_previous_lock_config, priv->dblayer_lock_config, 0);
+ }
dblayer_reset_env(li);
/*
* Once pEnv->remove (via dblayer_reset_env) has been called,
@@ -4786,8 +4799,8 @@ static int commit_good_database(dblayer_private *priv)
filename, PR_GetError(), slapd_pr_strerror(PR_GetError()) );
return -1;
}
- PR_snprintf(line,sizeof(line),"cachesize:%lu\nncache:%d\nversion:%d\n",
- priv->dblayer_cachesize, priv->dblayer_ncache, DB_VERSION_MAJOR);
+ PR_snprintf(line,sizeof(line),"cachesize:%lu\nncache:%d\nversion:%d\nlocks:%d\n",
+ (long unsigned int)priv->dblayer_cachesize, priv->dblayer_ncache, DB_VERSION_MAJOR, priv->dblayer_lock_config);
num_bytes = strlen(line);
return_value = slapi_write_buffer(prfd, line, num_bytes);
if (return_value != num_bytes)
@@ -4833,6 +4846,7 @@ static int read_metadata(struct ldbminfo *li)
* priv->dblayer_recovery_required = 0; */
priv->dblayer_previous_cachesize = 0;
priv->dblayer_previous_ncache = 0;
+ priv->dblayer_previous_lock_config = 0;
/* Open the guard file and read stuff, then delete it */
PR_snprintf(filename,sizeof(filename),"%s/guardian",priv->dblayer_home_directory);
@@ -4902,6 +4916,9 @@ static int read_metadata(struct ldbminfo *li)
number = atoi(value);
priv->dblayer_previous_ncache = number;
} else if (0 == strcmp("version",attribute)) {
+ } else if (0 == strcmp("locks",attribute)) {
+ number = atoi(value);
+ priv->dblayer_previous_lock_config = number;
}
if (NULL == nextline || '\0' == *nextline) {
/* Nothing more to read */
diff --git a/ldap/servers/slapd/back-ldbm/dblayer.h b/ldap/servers/slapd/back-ldbm/dblayer.h
index 4ff9d53..3e4f4d8 100644
--- a/ldap/servers/slapd/back-ldbm/dblayer.h
+++ b/ldap/servers/slapd/back-ldbm/dblayer.h
@@ -178,6 +178,8 @@ struct dblayer_private
PRCondVar *thread_count_cv; /* condition variable for housekeeping thread shutdown */
int dblayer_lockdown; /* use DB_LOCKDOWN */
int dblayer_lock_config;
+ int dblayer_previous_lock_config;/* Max lock count when we last shut down--
+ * used to determine if we delete the mpool */
u_int32_t dblayer_deadlock_policy; /* i.e. the atype to DB_ENV->lock_detect in deadlock_threadmain */
};
diff --git a/ldap/servers/slapd/back-ldbm/ldbm_config.c b/ldap/servers/slapd/back-ldbm/ldbm_config.c
index 11aa42d..462b0a1 100644
--- a/ldap/servers/slapd/back-ldbm/ldbm_config.c
+++ b/ldap/servers/slapd/back-ldbm/ldbm_config.c
@@ -948,7 +948,7 @@ static int ldbm_config_db_lock_set(void *arg, void *value, char *errorbuf, int p
if (apply) {
if (CONFIG_PHASE_RUNNING == phase) {
li->li_dblayer_private->dblayer_lock_config = val;
- LDAPDebug(LDAP_DEBUG_ANY, "New db cache size will not take affect until the server is restarted\n", 0, 0, 0);
+ LDAPDebug(LDAP_DEBUG_ANY, "New db max lock count will not take affect until the server is restarted\n", 0, 0, 0);
} else {
li->li_dblayer_private->dblayer_lock_config = val;
}
@@ -1390,7 +1390,7 @@ static config_info ldbm_config[] = {
{CONFIG_DB_VERBOSE, CONFIG_TYPE_ONOFF, "off", &ldbm_config_db_verbose_get, &ldbm_config_db_verbose_set, 0},
{CONFIG_DB_DEBUG, CONFIG_TYPE_ONOFF, "on", &ldbm_config_db_debug_get, &ldbm_config_db_debug_set, 0},
{CONFIG_DB_NAMED_REGIONS, CONFIG_TYPE_ONOFF, "off", &ldbm_config_db_named_regions_get, &ldbm_config_db_named_regions_set, 0},
- {CONFIG_DB_LOCK, CONFIG_TYPE_INT, "10000", &ldbm_config_db_lock_get, &ldbm_config_db_lock_set, 0},
+ {CONFIG_DB_LOCK, CONFIG_TYPE_INT, "10000", &ldbm_config_db_lock_get, &ldbm_config_db_lock_set, CONFIG_FLAG_ALWAYS_SHOW},
{CONFIG_DB_PRIVATE_MEM, CONFIG_TYPE_ONOFF, "off", &ldbm_config_db_private_mem_get, &ldbm_config_db_private_mem_set, 0},
{CONFIG_DB_PRIVATE_IMPORT_MEM, CONFIG_TYPE_ONOFF, "on", &ldbm_config_db_private_import_mem_get, &ldbm_config_db_private_import_mem_set, CONFIG_FLAG_ALWAYS_SHOW|CONFIG_FLAG_ALLOW_RUNNING_CHANGE},
{CONDIF_DB_ONLINE_IMPORT_ENCRYPT, CONFIG_TYPE_ONOFF, "on", &ldbm_config_db_online_import_encrypt_get, &ldbm_config_db_online_import_encrypt_set, 0},
9 years, 2 months
Branch '389-ds-base-1.3.1' - ldap/servers
by Noriko Hosoi
ldap/servers/slapd/back-ldbm/dblayer.c | 33 +++++++++++++++++++++--------
ldap/servers/slapd/back-ldbm/dblayer.h | 2 +
ldap/servers/slapd/back-ldbm/ldbm_config.c | 4 +--
3 files changed, 29 insertions(+), 10 deletions(-)
New commits:
commit 86b728f88fe0d35f403c012166f98c3a0e69ad32
Author: Noriko Hosoi <nhosoi(a)redhat.com>
Date: Fri Jan 9 16:50:12 2015 -0800
Ticket #47934 - nsslapd-db-locks modify not taking into account.
Description: Updating the value of nsslapd-db-locks was not detected
at the server's startup time. As suggested in
https://fedorahosted.org/389/ticket/47934#comment:1
the value is stored in the guardian file as "locks:20000" at the shut-
down time. When restarting the server, the nsslapd-db-locks value in
cn=config,cn=ldbm database,cn=plugins,cn=config is compared with the
stored value (20000, in this example) and if they don't match, the
lock table is recreated. The change is logged in the error log:
[...] - resizing max db lock count: 20000 -> 30000
https://fedorahosted.org/389/ticket/47934
Reviewed by mreynolds(a)redhat.com (Thank you, Mark!!)
(cherry picked from commit f4437defacf8812c5f95869147a99f8412dc4a07)
(cherry picked from commit dc4185ea40e1f1b8527a67a0c854fcc29b8bafe7)
(cherry picked from commit d1e4698530868532bd472c70ca8ccc4a317b4199)
diff --git a/ldap/servers/slapd/back-ldbm/dblayer.c b/ldap/servers/slapd/back-ldbm/dblayer.c
index 89effd4..b4803ad 100644
--- a/ldap/servers/slapd/back-ldbm/dblayer.c
+++ b/ldap/servers/slapd/back-ldbm/dblayer.c
@@ -1070,6 +1070,8 @@ static void dblayer_dump_config_tracing(dblayer_private *priv)
LDAPDebug(LDAP_DEBUG_TRACE,"private import mem=%d\n",priv->dblayer_private_import_mem,0,0);
LDAPDebug(LDAP_DEBUG_TRACE,"shm_key=%ld\n",priv->dblayer_shm_key,0,0);
LDAPDebug(LDAP_DEBUG_TRACE,"lockdown=%d\n",priv->dblayer_lockdown,0,0);
+ LDAPDebug(LDAP_DEBUG_TRACE,"locks=%d\n",priv->dblayer_lock_config,0,0);
+ LDAPDebug(LDAP_DEBUG_TRACE,"previous_locks=%d\n",priv->dblayer_previous_lock_config,0,0);
LDAPDebug(LDAP_DEBUG_TRACE,"tx_max=%d\n",priv->dblayer_tx_max,0,0);
}
@@ -1624,13 +1626,24 @@ dblayer_start(struct ldbminfo *li, int dbmode)
/* Is the cache being re-sized ? (If we're just doing an archive or export,
* we don't care if the cache is being re-sized) */
- if ( (priv->dblayer_previous_cachesize || priv->dblayer_previous_ncache) &&
- ((priv->dblayer_cachesize != priv->dblayer_previous_cachesize) ||
- (priv->dblayer_ncache != priv->dblayer_previous_ncache)) &&
- !(dbmode & (DBLAYER_ARCHIVE_MODE|DBLAYER_EXPORT_MODE)) ) {
- LDAPDebug(LDAP_DEBUG_ANY,
- "I'm resizing my cache now...cache was %lu and is now %lu\n",
+ if ((priv->dblayer_previous_cachesize || priv->dblayer_previous_ncache) &&
+ (priv->dblayer_previous_lock_config) &&
+ ((priv->dblayer_cachesize != priv->dblayer_previous_cachesize) ||
+ (priv->dblayer_ncache != priv->dblayer_previous_ncache) ||
+ (priv->dblayer_lock_config != priv->dblayer_previous_lock_config)) &&
+ !(dbmode & (DBLAYER_ARCHIVE_MODE|DBLAYER_EXPORT_MODE)) ) {
+ if (priv->dblayer_cachesize != priv->dblayer_previous_cachesize) {
+ LDAPDebug(LDAP_DEBUG_ANY, "resizing db cache size: %lu -> %lu\n",
priv->dblayer_previous_cachesize, priv->dblayer_cachesize, 0);
+ }
+ if (priv->dblayer_ncache != priv->dblayer_previous_ncache) {
+ LDAPDebug(LDAP_DEBUG_ANY, "resizing db cache count: %d -> %d\n",
+ priv->dblayer_previous_ncache, priv->dblayer_ncache, 0);
+ }
+ if (priv->dblayer_lock_config != priv->dblayer_previous_lock_config) {
+ LDAPDebug(LDAP_DEBUG_ANY, "resizing max db lock count: %d -> %d\n",
+ priv->dblayer_previous_lock_config, priv->dblayer_lock_config, 0);
+ }
dblayer_reset_env(li);
/*
* Once pEnv->remove (via dblayer_reset_env) has been called,
@@ -4897,8 +4910,8 @@ static int commit_good_database(dblayer_private *priv)
filename, PR_GetError(), slapd_pr_strerror(PR_GetError()) );
return -1;
}
- PR_snprintf(line,sizeof(line),"cachesize:%lu\nncache:%d\nversion:%d\n",
- (long unsigned int)priv->dblayer_cachesize, priv->dblayer_ncache, DB_VERSION_MAJOR);
+ PR_snprintf(line,sizeof(line),"cachesize:%lu\nncache:%d\nversion:%d\nlocks:%d\n",
+ (long unsigned int)priv->dblayer_cachesize, priv->dblayer_ncache, DB_VERSION_MAJOR, priv->dblayer_lock_config);
num_bytes = strlen(line);
return_value = slapi_write_buffer(prfd, line, num_bytes);
if (return_value != num_bytes)
@@ -4944,6 +4957,7 @@ static int read_metadata(struct ldbminfo *li)
* priv->dblayer_recovery_required = 0; */
priv->dblayer_previous_cachesize = 0;
priv->dblayer_previous_ncache = 0;
+ priv->dblayer_previous_lock_config = 0;
/* Open the guard file and read stuff, then delete it */
PR_snprintf(filename,sizeof(filename),"%s/guardian",priv->dblayer_home_directory);
@@ -5013,6 +5027,9 @@ static int read_metadata(struct ldbminfo *li)
number = atoi(value);
priv->dblayer_previous_ncache = number;
} else if (0 == strcmp("version",attribute)) {
+ } else if (0 == strcmp("locks",attribute)) {
+ number = atoi(value);
+ priv->dblayer_previous_lock_config = number;
}
if (NULL == nextline || '\0' == *nextline) {
/* Nothing more to read */
diff --git a/ldap/servers/slapd/back-ldbm/dblayer.h b/ldap/servers/slapd/back-ldbm/dblayer.h
index 4ff9d53..3e4f4d8 100644
--- a/ldap/servers/slapd/back-ldbm/dblayer.h
+++ b/ldap/servers/slapd/back-ldbm/dblayer.h
@@ -178,6 +178,8 @@ struct dblayer_private
PRCondVar *thread_count_cv; /* condition variable for housekeeping thread shutdown */
int dblayer_lockdown; /* use DB_LOCKDOWN */
int dblayer_lock_config;
+ int dblayer_previous_lock_config;/* Max lock count when we last shut down--
+ * used to determine if we delete the mpool */
u_int32_t dblayer_deadlock_policy; /* i.e. the atype to DB_ENV->lock_detect in deadlock_threadmain */
};
diff --git a/ldap/servers/slapd/back-ldbm/ldbm_config.c b/ldap/servers/slapd/back-ldbm/ldbm_config.c
index b5bf1bf..c74fbb7 100644
--- a/ldap/servers/slapd/back-ldbm/ldbm_config.c
+++ b/ldap/servers/slapd/back-ldbm/ldbm_config.c
@@ -948,7 +948,7 @@ static int ldbm_config_db_lock_set(void *arg, void *value, char *errorbuf, int p
if (apply) {
if (CONFIG_PHASE_RUNNING == phase) {
li->li_dblayer_private->dblayer_lock_config = val;
- LDAPDebug(LDAP_DEBUG_ANY, "New db cache size will not take affect until the server is restarted\n", 0, 0, 0);
+ LDAPDebug(LDAP_DEBUG_ANY, "New db max lock count will not take affect until the server is restarted\n", 0, 0, 0);
} else {
li->li_dblayer_private->dblayer_lock_config = val;
}
@@ -1390,7 +1390,7 @@ static config_info ldbm_config[] = {
{CONFIG_DB_VERBOSE, CONFIG_TYPE_ONOFF, "off", &ldbm_config_db_verbose_get, &ldbm_config_db_verbose_set, 0},
{CONFIG_DB_DEBUG, CONFIG_TYPE_ONOFF, "on", &ldbm_config_db_debug_get, &ldbm_config_db_debug_set, 0},
{CONFIG_DB_NAMED_REGIONS, CONFIG_TYPE_ONOFF, "off", &ldbm_config_db_named_regions_get, &ldbm_config_db_named_regions_set, 0},
- {CONFIG_DB_LOCK, CONFIG_TYPE_INT, "10000", &ldbm_config_db_lock_get, &ldbm_config_db_lock_set, 0},
+ {CONFIG_DB_LOCK, CONFIG_TYPE_INT, "10000", &ldbm_config_db_lock_get, &ldbm_config_db_lock_set, CONFIG_FLAG_ALWAYS_SHOW},
{CONFIG_DB_PRIVATE_MEM, CONFIG_TYPE_ONOFF, "off", &ldbm_config_db_private_mem_get, &ldbm_config_db_private_mem_set, 0},
{CONFIG_DB_PRIVATE_IMPORT_MEM, CONFIG_TYPE_ONOFF, "on", &ldbm_config_db_private_import_mem_get, &ldbm_config_db_private_import_mem_set, CONFIG_FLAG_ALWAYS_SHOW|CONFIG_FLAG_ALLOW_RUNNING_CHANGE},
{CONDIF_DB_ONLINE_IMPORT_ENCRYPT, CONFIG_TYPE_ONOFF, "on", &ldbm_config_db_online_import_encrypt_get, &ldbm_config_db_online_import_encrypt_set, 0},
9 years, 2 months
Branch '389-ds-base-1.3.2' - ldap/servers
by Noriko Hosoi
ldap/servers/slapd/back-ldbm/dblayer.c | 33 +++++++++++++++++++++--------
ldap/servers/slapd/back-ldbm/dblayer.h | 2 +
ldap/servers/slapd/back-ldbm/ldbm_config.c | 4 +--
3 files changed, 29 insertions(+), 10 deletions(-)
New commits:
commit d1e4698530868532bd472c70ca8ccc4a317b4199
Author: Noriko Hosoi <nhosoi(a)redhat.com>
Date: Fri Jan 9 16:50:12 2015 -0800
Ticket #47934 - nsslapd-db-locks modify not taking into account.
Description: Updating the value of nsslapd-db-locks was not detected
at the server's startup time. As suggested in
https://fedorahosted.org/389/ticket/47934#comment:1
the value is stored in the guardian file as "locks:20000" at the shut-
down time. When restarting the server, the nsslapd-db-locks value in
cn=config,cn=ldbm database,cn=plugins,cn=config is compared with the
stored value (20000, in this example) and if they don't match, the
lock table is recreated. The change is logged in the error log:
[...] - resizing max db lock count: 20000 -> 30000
https://fedorahosted.org/389/ticket/47934
Reviewed by mreynolds(a)redhat.com (Thank you, Mark!!)
(cherry picked from commit f4437defacf8812c5f95869147a99f8412dc4a07)
(cherry picked from commit dc4185ea40e1f1b8527a67a0c854fcc29b8bafe7)
diff --git a/ldap/servers/slapd/back-ldbm/dblayer.c b/ldap/servers/slapd/back-ldbm/dblayer.c
index 8e60210..76315a4 100644
--- a/ldap/servers/slapd/back-ldbm/dblayer.c
+++ b/ldap/servers/slapd/back-ldbm/dblayer.c
@@ -1163,6 +1163,8 @@ static void dblayer_dump_config_tracing(dblayer_private *priv)
LDAPDebug(LDAP_DEBUG_TRACE,"private import mem=%d\n",priv->dblayer_private_import_mem,0,0);
LDAPDebug(LDAP_DEBUG_TRACE,"shm_key=%ld\n",priv->dblayer_shm_key,0,0);
LDAPDebug(LDAP_DEBUG_TRACE,"lockdown=%d\n",priv->dblayer_lockdown,0,0);
+ LDAPDebug(LDAP_DEBUG_TRACE,"locks=%d\n",priv->dblayer_lock_config,0,0);
+ LDAPDebug(LDAP_DEBUG_TRACE,"previous_locks=%d\n",priv->dblayer_previous_lock_config,0,0);
LDAPDebug(LDAP_DEBUG_TRACE,"tx_max=%d\n",priv->dblayer_tx_max,0,0);
}
@@ -1718,13 +1720,24 @@ dblayer_start(struct ldbminfo *li, int dbmode)
/* Is the cache being re-sized ? (If we're just doing an archive or export,
* we don't care if the cache is being re-sized) */
- if ( (priv->dblayer_previous_cachesize || priv->dblayer_previous_ncache) &&
- ((priv->dblayer_cachesize != priv->dblayer_previous_cachesize) ||
- (priv->dblayer_ncache != priv->dblayer_previous_ncache)) &&
- !(dbmode & (DBLAYER_ARCHIVE_MODE|DBLAYER_EXPORT_MODE)) ) {
- LDAPDebug(LDAP_DEBUG_ANY,
- "I'm resizing my cache now...cache was %lu and is now %lu\n",
+ if ((priv->dblayer_previous_cachesize || priv->dblayer_previous_ncache) &&
+ (priv->dblayer_previous_lock_config) &&
+ ((priv->dblayer_cachesize != priv->dblayer_previous_cachesize) ||
+ (priv->dblayer_ncache != priv->dblayer_previous_ncache) ||
+ (priv->dblayer_lock_config != priv->dblayer_previous_lock_config)) &&
+ !(dbmode & (DBLAYER_ARCHIVE_MODE|DBLAYER_EXPORT_MODE)) ) {
+ if (priv->dblayer_cachesize != priv->dblayer_previous_cachesize) {
+ LDAPDebug(LDAP_DEBUG_ANY, "resizing db cache size: %lu -> %lu\n",
priv->dblayer_previous_cachesize, priv->dblayer_cachesize, 0);
+ }
+ if (priv->dblayer_ncache != priv->dblayer_previous_ncache) {
+ LDAPDebug(LDAP_DEBUG_ANY, "resizing db cache count: %d -> %d\n",
+ priv->dblayer_previous_ncache, priv->dblayer_ncache, 0);
+ }
+ if (priv->dblayer_lock_config != priv->dblayer_previous_lock_config) {
+ LDAPDebug(LDAP_DEBUG_ANY, "resizing max db lock count: %d -> %d\n",
+ priv->dblayer_previous_lock_config, priv->dblayer_lock_config, 0);
+ }
dblayer_reset_env(li);
/*
* Once pEnv->remove (via dblayer_reset_env) has been called,
@@ -5189,8 +5202,8 @@ static int commit_good_database(dblayer_private *priv)
filename, PR_GetError(), slapd_pr_strerror(PR_GetError()) );
return -1;
}
- PR_snprintf(line,sizeof(line),"cachesize:%lu\nncache:%d\nversion:%d\n",
- (long unsigned int)priv->dblayer_cachesize, priv->dblayer_ncache, DB_VERSION_MAJOR);
+ PR_snprintf(line,sizeof(line),"cachesize:%lu\nncache:%d\nversion:%d\nlocks:%d\n",
+ (long unsigned int)priv->dblayer_cachesize, priv->dblayer_ncache, DB_VERSION_MAJOR, priv->dblayer_lock_config);
num_bytes = strlen(line);
return_value = slapi_write_buffer(prfd, line, num_bytes);
if (return_value != num_bytes)
@@ -5236,6 +5249,7 @@ static int read_metadata(struct ldbminfo *li)
* priv->dblayer_recovery_required = 0; */
priv->dblayer_previous_cachesize = 0;
priv->dblayer_previous_ncache = 0;
+ priv->dblayer_previous_lock_config = 0;
/* Open the guard file and read stuff, then delete it */
PR_snprintf(filename,sizeof(filename),"%s/guardian",priv->dblayer_home_directory);
@@ -5305,6 +5319,9 @@ static int read_metadata(struct ldbminfo *li)
number = atoi(value);
priv->dblayer_previous_ncache = number;
} else if (0 == strcmp("version",attribute)) {
+ } else if (0 == strcmp("locks",attribute)) {
+ number = atoi(value);
+ priv->dblayer_previous_lock_config = number;
}
if (NULL == nextline || '\0' == *nextline) {
/* Nothing more to read */
diff --git a/ldap/servers/slapd/back-ldbm/dblayer.h b/ldap/servers/slapd/back-ldbm/dblayer.h
index e1a178e..3094260 100644
--- a/ldap/servers/slapd/back-ldbm/dblayer.h
+++ b/ldap/servers/slapd/back-ldbm/dblayer.h
@@ -178,6 +178,8 @@ struct dblayer_private
PRCondVar *thread_count_cv; /* condition variable for housekeeping thread shutdown */
int dblayer_lockdown; /* use DB_LOCKDOWN */
int dblayer_lock_config;
+ int dblayer_previous_lock_config;/* Max lock count when we last shut down--
+ * used to determine if we delete the mpool */
u_int32_t dblayer_deadlock_policy; /* i.e. the atype to DB_ENV->lock_detect in deadlock_threadmain */
int dblayer_compactdb_interval; /* interval to execute compact id2entry dbs */
};
diff --git a/ldap/servers/slapd/back-ldbm/ldbm_config.c b/ldap/servers/slapd/back-ldbm/ldbm_config.c
index 1a8d8a9..db34afa 100644
--- a/ldap/servers/slapd/back-ldbm/ldbm_config.c
+++ b/ldap/servers/slapd/back-ldbm/ldbm_config.c
@@ -1036,7 +1036,7 @@ static int ldbm_config_db_lock_set(void *arg, void *value, char *errorbuf, int p
if (apply) {
if (CONFIG_PHASE_RUNNING == phase) {
li->li_dblayer_private->dblayer_lock_config = val;
- LDAPDebug(LDAP_DEBUG_ANY, "New db cache size will not take affect until the server is restarted\n", 0, 0, 0);
+ LDAPDebug(LDAP_DEBUG_ANY, "New db max lock count will not take affect until the server is restarted\n", 0, 0, 0);
} else {
li->li_dblayer_private->dblayer_lock_config = val;
}
@@ -1482,7 +1482,7 @@ static config_info ldbm_config[] = {
{CONFIG_DB_VERBOSE, CONFIG_TYPE_ONOFF, "off", &ldbm_config_db_verbose_get, &ldbm_config_db_verbose_set, 0},
{CONFIG_DB_DEBUG, CONFIG_TYPE_ONOFF, "on", &ldbm_config_db_debug_get, &ldbm_config_db_debug_set, 0},
{CONFIG_DB_NAMED_REGIONS, CONFIG_TYPE_ONOFF, "off", &ldbm_config_db_named_regions_get, &ldbm_config_db_named_regions_set, 0},
- {CONFIG_DB_LOCK, CONFIG_TYPE_INT, "10000", &ldbm_config_db_lock_get, &ldbm_config_db_lock_set, 0},
+ {CONFIG_DB_LOCK, CONFIG_TYPE_INT, "10000", &ldbm_config_db_lock_get, &ldbm_config_db_lock_set, CONFIG_FLAG_ALWAYS_SHOW},
{CONFIG_DB_PRIVATE_MEM, CONFIG_TYPE_ONOFF, "off", &ldbm_config_db_private_mem_get, &ldbm_config_db_private_mem_set, 0},
{CONFIG_DB_PRIVATE_IMPORT_MEM, CONFIG_TYPE_ONOFF, "on", &ldbm_config_db_private_import_mem_get, &ldbm_config_db_private_import_mem_set, CONFIG_FLAG_ALWAYS_SHOW|CONFIG_FLAG_ALLOW_RUNNING_CHANGE},
{CONDIF_DB_ONLINE_IMPORT_ENCRYPT, CONFIG_TYPE_ONOFF, "on", &ldbm_config_db_online_import_encrypt_get, &ldbm_config_db_online_import_encrypt_set, 0},
9 years, 2 months
Branch '389-ds-base-1.3.3' - ldap/servers
by Noriko Hosoi
ldap/servers/slapd/back-ldbm/dblayer.c | 33 +++++++++++++++++++++--------
ldap/servers/slapd/back-ldbm/dblayer.h | 2 +
ldap/servers/slapd/back-ldbm/ldbm_config.c | 4 +--
3 files changed, 29 insertions(+), 10 deletions(-)
New commits:
commit dc4185ea40e1f1b8527a67a0c854fcc29b8bafe7
Author: Noriko Hosoi <nhosoi(a)redhat.com>
Date: Fri Jan 9 16:50:12 2015 -0800
Ticket #47934 - nsslapd-db-locks modify not taking into account.
Description: Updating the value of nsslapd-db-locks was not detected
at the server's startup time. As suggested in
https://fedorahosted.org/389/ticket/47934#comment:1
the value is stored in the guardian file as "locks:20000" at the shut-
down time. When restarting the server, the nsslapd-db-locks value in
cn=config,cn=ldbm database,cn=plugins,cn=config is compared with the
stored value (20000, in this example) and if they don't match, the
lock table is recreated. The change is logged in the error log:
[...] - resizing max db lock count: 20000 -> 30000
https://fedorahosted.org/389/ticket/47934
Reviewed by mreynolds(a)redhat.com (Thank you, Mark!!)
(cherry picked from commit f4437defacf8812c5f95869147a99f8412dc4a07)
diff --git a/ldap/servers/slapd/back-ldbm/dblayer.c b/ldap/servers/slapd/back-ldbm/dblayer.c
index 2524355..0fad5ff 100644
--- a/ldap/servers/slapd/back-ldbm/dblayer.c
+++ b/ldap/servers/slapd/back-ldbm/dblayer.c
@@ -1163,6 +1163,8 @@ static void dblayer_dump_config_tracing(dblayer_private *priv)
LDAPDebug(LDAP_DEBUG_TRACE,"private import mem=%d\n",priv->dblayer_private_import_mem,0,0);
LDAPDebug(LDAP_DEBUG_TRACE,"shm_key=%ld\n",priv->dblayer_shm_key,0,0);
LDAPDebug(LDAP_DEBUG_TRACE,"lockdown=%d\n",priv->dblayer_lockdown,0,0);
+ LDAPDebug(LDAP_DEBUG_TRACE,"locks=%d\n",priv->dblayer_lock_config,0,0);
+ LDAPDebug(LDAP_DEBUG_TRACE,"previous_locks=%d\n",priv->dblayer_previous_lock_config,0,0);
LDAPDebug(LDAP_DEBUG_TRACE,"tx_max=%d\n",priv->dblayer_tx_max,0,0);
}
@@ -1718,13 +1720,24 @@ dblayer_start(struct ldbminfo *li, int dbmode)
/* Is the cache being re-sized ? (If we're just doing an archive or export,
* we don't care if the cache is being re-sized) */
- if ( (priv->dblayer_previous_cachesize || priv->dblayer_previous_ncache) &&
- ((priv->dblayer_cachesize != priv->dblayer_previous_cachesize) ||
- (priv->dblayer_ncache != priv->dblayer_previous_ncache)) &&
- !(dbmode & (DBLAYER_ARCHIVE_MODE|DBLAYER_EXPORT_MODE)) ) {
- LDAPDebug(LDAP_DEBUG_ANY,
- "I'm resizing my cache now...cache was %lu and is now %lu\n",
+ if ((priv->dblayer_previous_cachesize || priv->dblayer_previous_ncache) &&
+ (priv->dblayer_previous_lock_config) &&
+ ((priv->dblayer_cachesize != priv->dblayer_previous_cachesize) ||
+ (priv->dblayer_ncache != priv->dblayer_previous_ncache) ||
+ (priv->dblayer_lock_config != priv->dblayer_previous_lock_config)) &&
+ !(dbmode & (DBLAYER_ARCHIVE_MODE|DBLAYER_EXPORT_MODE)) ) {
+ if (priv->dblayer_cachesize != priv->dblayer_previous_cachesize) {
+ LDAPDebug(LDAP_DEBUG_ANY, "resizing db cache size: %lu -> %lu\n",
priv->dblayer_previous_cachesize, priv->dblayer_cachesize, 0);
+ }
+ if (priv->dblayer_ncache != priv->dblayer_previous_ncache) {
+ LDAPDebug(LDAP_DEBUG_ANY, "resizing db cache count: %d -> %d\n",
+ priv->dblayer_previous_ncache, priv->dblayer_ncache, 0);
+ }
+ if (priv->dblayer_lock_config != priv->dblayer_previous_lock_config) {
+ LDAPDebug(LDAP_DEBUG_ANY, "resizing max db lock count: %d -> %d\n",
+ priv->dblayer_previous_lock_config, priv->dblayer_lock_config, 0);
+ }
dblayer_reset_env(li);
/*
* Once pEnv->remove (via dblayer_reset_env) has been called,
@@ -5200,8 +5213,8 @@ static int commit_good_database(dblayer_private *priv)
filename, PR_GetError(), slapd_pr_strerror(PR_GetError()) );
return -1;
}
- PR_snprintf(line,sizeof(line),"cachesize:%lu\nncache:%d\nversion:%d\n",
- (long unsigned int)priv->dblayer_cachesize, priv->dblayer_ncache, DB_VERSION_MAJOR);
+ PR_snprintf(line,sizeof(line),"cachesize:%lu\nncache:%d\nversion:%d\nlocks:%d\n",
+ (long unsigned int)priv->dblayer_cachesize, priv->dblayer_ncache, DB_VERSION_MAJOR, priv->dblayer_lock_config);
num_bytes = strlen(line);
return_value = slapi_write_buffer(prfd, line, num_bytes);
if (return_value != num_bytes)
@@ -5247,6 +5260,7 @@ static int read_metadata(struct ldbminfo *li)
* priv->dblayer_recovery_required = 0; */
priv->dblayer_previous_cachesize = 0;
priv->dblayer_previous_ncache = 0;
+ priv->dblayer_previous_lock_config = 0;
/* Open the guard file and read stuff, then delete it */
PR_snprintf(filename,sizeof(filename),"%s/guardian",priv->dblayer_home_directory);
@@ -5316,6 +5330,9 @@ static int read_metadata(struct ldbminfo *li)
number = atoi(value);
priv->dblayer_previous_ncache = number;
} else if (0 == strcmp("version",attribute)) {
+ } else if (0 == strcmp("locks",attribute)) {
+ number = atoi(value);
+ priv->dblayer_previous_lock_config = number;
}
if (NULL == nextline || '\0' == *nextline) {
/* Nothing more to read */
diff --git a/ldap/servers/slapd/back-ldbm/dblayer.h b/ldap/servers/slapd/back-ldbm/dblayer.h
index e1a178e..3094260 100644
--- a/ldap/servers/slapd/back-ldbm/dblayer.h
+++ b/ldap/servers/slapd/back-ldbm/dblayer.h
@@ -178,6 +178,8 @@ struct dblayer_private
PRCondVar *thread_count_cv; /* condition variable for housekeeping thread shutdown */
int dblayer_lockdown; /* use DB_LOCKDOWN */
int dblayer_lock_config;
+ int dblayer_previous_lock_config;/* Max lock count when we last shut down--
+ * used to determine if we delete the mpool */
u_int32_t dblayer_deadlock_policy; /* i.e. the atype to DB_ENV->lock_detect in deadlock_threadmain */
int dblayer_compactdb_interval; /* interval to execute compact id2entry dbs */
};
diff --git a/ldap/servers/slapd/back-ldbm/ldbm_config.c b/ldap/servers/slapd/back-ldbm/ldbm_config.c
index 294999c..2092d08 100644
--- a/ldap/servers/slapd/back-ldbm/ldbm_config.c
+++ b/ldap/servers/slapd/back-ldbm/ldbm_config.c
@@ -1045,7 +1045,7 @@ static int ldbm_config_db_lock_set(void *arg, void *value, char *errorbuf, int p
if (apply) {
if (CONFIG_PHASE_RUNNING == phase) {
li->li_dblayer_private->dblayer_lock_config = val;
- LDAPDebug(LDAP_DEBUG_ANY, "New db cache size will not take affect until the server is restarted\n", 0, 0, 0);
+ LDAPDebug(LDAP_DEBUG_ANY, "New db max lock count will not take affect until the server is restarted\n", 0, 0, 0);
} else {
li->li_dblayer_private->dblayer_lock_config = val;
}
@@ -1506,7 +1506,7 @@ static config_info ldbm_config[] = {
{CONFIG_DB_VERBOSE, CONFIG_TYPE_ONOFF, "off", &ldbm_config_db_verbose_get, &ldbm_config_db_verbose_set, 0},
{CONFIG_DB_DEBUG, CONFIG_TYPE_ONOFF, "on", &ldbm_config_db_debug_get, &ldbm_config_db_debug_set, 0},
{CONFIG_DB_NAMED_REGIONS, CONFIG_TYPE_ONOFF, "off", &ldbm_config_db_named_regions_get, &ldbm_config_db_named_regions_set, 0},
- {CONFIG_DB_LOCK, CONFIG_TYPE_INT, "10000", &ldbm_config_db_lock_get, &ldbm_config_db_lock_set, 0},
+ {CONFIG_DB_LOCK, CONFIG_TYPE_INT, "10000", &ldbm_config_db_lock_get, &ldbm_config_db_lock_set, CONFIG_FLAG_ALWAYS_SHOW},
{CONFIG_DB_PRIVATE_MEM, CONFIG_TYPE_ONOFF, "off", &ldbm_config_db_private_mem_get, &ldbm_config_db_private_mem_set, 0},
{CONFIG_DB_PRIVATE_IMPORT_MEM, CONFIG_TYPE_ONOFF, "on", &ldbm_config_db_private_import_mem_get, &ldbm_config_db_private_import_mem_set, CONFIG_FLAG_ALWAYS_SHOW|CONFIG_FLAG_ALLOW_RUNNING_CHANGE},
{CONDIF_DB_ONLINE_IMPORT_ENCRYPT, CONFIG_TYPE_ONOFF, "on", &ldbm_config_db_online_import_encrypt_get, &ldbm_config_db_online_import_encrypt_set, 0},
9 years, 2 months
ldap/servers
by Noriko Hosoi
ldap/servers/slapd/back-ldbm/dblayer.c | 33 +++++++++++++++++++++--------
ldap/servers/slapd/back-ldbm/dblayer.h | 2 +
ldap/servers/slapd/back-ldbm/ldbm_config.c | 4 +--
3 files changed, 29 insertions(+), 10 deletions(-)
New commits:
commit f4437defacf8812c5f95869147a99f8412dc4a07
Author: Noriko Hosoi <nhosoi(a)redhat.com>
Date: Fri Jan 9 16:50:12 2015 -0800
Ticket #47934 - nsslapd-db-locks modify not taking into account.
Description: Updating the value of nsslapd-db-locks was not detected
at the server's startup time. As suggested in
https://fedorahosted.org/389/ticket/47934#comment:1
the value is stored in the guardian file as "locks:20000" at the shut-
down time. When restarting the server, the nsslapd-db-locks value in
cn=config,cn=ldbm database,cn=plugins,cn=config is compared with the
stored value (20000, in this example) and if they don't match, the
lock table is recreated. The change is logged in the error log:
[...] - resizing max db lock count: 20000 -> 30000
https://fedorahosted.org/389/ticket/47934
Reviewed by mreynolds(a)redhat.com (Thank you, Mark!!)
diff --git a/ldap/servers/slapd/back-ldbm/dblayer.c b/ldap/servers/slapd/back-ldbm/dblayer.c
index e7339fb..ddf6bb0 100644
--- a/ldap/servers/slapd/back-ldbm/dblayer.c
+++ b/ldap/servers/slapd/back-ldbm/dblayer.c
@@ -1163,6 +1163,8 @@ static void dblayer_dump_config_tracing(dblayer_private *priv)
LDAPDebug(LDAP_DEBUG_TRACE,"private import mem=%d\n",priv->dblayer_private_import_mem,0,0);
LDAPDebug(LDAP_DEBUG_TRACE,"shm_key=%ld\n",priv->dblayer_shm_key,0,0);
LDAPDebug(LDAP_DEBUG_TRACE,"lockdown=%d\n",priv->dblayer_lockdown,0,0);
+ LDAPDebug(LDAP_DEBUG_TRACE,"locks=%d\n",priv->dblayer_lock_config,0,0);
+ LDAPDebug(LDAP_DEBUG_TRACE,"previous_locks=%d\n",priv->dblayer_previous_lock_config,0,0);
LDAPDebug(LDAP_DEBUG_TRACE,"tx_max=%d\n",priv->dblayer_tx_max,0,0);
}
@@ -1718,13 +1720,24 @@ dblayer_start(struct ldbminfo *li, int dbmode)
/* Is the cache being re-sized ? (If we're just doing an archive or export,
* we don't care if the cache is being re-sized) */
- if ( (priv->dblayer_previous_cachesize || priv->dblayer_previous_ncache) &&
- ((priv->dblayer_cachesize != priv->dblayer_previous_cachesize) ||
- (priv->dblayer_ncache != priv->dblayer_previous_ncache)) &&
- !(dbmode & (DBLAYER_ARCHIVE_MODE|DBLAYER_EXPORT_MODE)) ) {
- LDAPDebug(LDAP_DEBUG_ANY,
- "I'm resizing my cache now...cache was %lu and is now %lu\n",
+ if ((priv->dblayer_previous_cachesize || priv->dblayer_previous_ncache) &&
+ (priv->dblayer_previous_lock_config) &&
+ ((priv->dblayer_cachesize != priv->dblayer_previous_cachesize) ||
+ (priv->dblayer_ncache != priv->dblayer_previous_ncache) ||
+ (priv->dblayer_lock_config != priv->dblayer_previous_lock_config)) &&
+ !(dbmode & (DBLAYER_ARCHIVE_MODE|DBLAYER_EXPORT_MODE)) ) {
+ if (priv->dblayer_cachesize != priv->dblayer_previous_cachesize) {
+ LDAPDebug(LDAP_DEBUG_ANY, "resizing db cache size: %lu -> %lu\n",
priv->dblayer_previous_cachesize, priv->dblayer_cachesize, 0);
+ }
+ if (priv->dblayer_ncache != priv->dblayer_previous_ncache) {
+ LDAPDebug(LDAP_DEBUG_ANY, "resizing db cache count: %d -> %d\n",
+ priv->dblayer_previous_ncache, priv->dblayer_ncache, 0);
+ }
+ if (priv->dblayer_lock_config != priv->dblayer_previous_lock_config) {
+ LDAPDebug(LDAP_DEBUG_ANY, "resizing max db lock count: %d -> %d\n",
+ priv->dblayer_previous_lock_config, priv->dblayer_lock_config, 0);
+ }
dblayer_reset_env(li);
/*
* Once pEnv->remove (via dblayer_reset_env) has been called,
@@ -5209,8 +5222,8 @@ static int commit_good_database(dblayer_private *priv)
filename, PR_GetError(), slapd_pr_strerror(PR_GetError()) );
return -1;
}
- PR_snprintf(line,sizeof(line),"cachesize:%lu\nncache:%d\nversion:%d\n",
- (long unsigned int)priv->dblayer_cachesize, priv->dblayer_ncache, DB_VERSION_MAJOR);
+ PR_snprintf(line,sizeof(line),"cachesize:%lu\nncache:%d\nversion:%d\nlocks:%d\n",
+ (long unsigned int)priv->dblayer_cachesize, priv->dblayer_ncache, DB_VERSION_MAJOR, priv->dblayer_lock_config);
num_bytes = strlen(line);
return_value = slapi_write_buffer(prfd, line, num_bytes);
if (return_value != num_bytes)
@@ -5256,6 +5269,7 @@ static int read_metadata(struct ldbminfo *li)
* priv->dblayer_recovery_required = 0; */
priv->dblayer_previous_cachesize = 0;
priv->dblayer_previous_ncache = 0;
+ priv->dblayer_previous_lock_config = 0;
/* Open the guard file and read stuff, then delete it */
PR_snprintf(filename,sizeof(filename),"%s/guardian",priv->dblayer_home_directory);
@@ -5325,6 +5339,9 @@ static int read_metadata(struct ldbminfo *li)
number = atoi(value);
priv->dblayer_previous_ncache = number;
} else if (0 == strcmp("version",attribute)) {
+ } else if (0 == strcmp("locks",attribute)) {
+ number = atoi(value);
+ priv->dblayer_previous_lock_config = number;
}
if (NULL == nextline || '\0' == *nextline) {
/* Nothing more to read */
diff --git a/ldap/servers/slapd/back-ldbm/dblayer.h b/ldap/servers/slapd/back-ldbm/dblayer.h
index e1a178e..3094260 100644
--- a/ldap/servers/slapd/back-ldbm/dblayer.h
+++ b/ldap/servers/slapd/back-ldbm/dblayer.h
@@ -178,6 +178,8 @@ struct dblayer_private
PRCondVar *thread_count_cv; /* condition variable for housekeeping thread shutdown */
int dblayer_lockdown; /* use DB_LOCKDOWN */
int dblayer_lock_config;
+ int dblayer_previous_lock_config;/* Max lock count when we last shut down--
+ * used to determine if we delete the mpool */
u_int32_t dblayer_deadlock_policy; /* i.e. the atype to DB_ENV->lock_detect in deadlock_threadmain */
int dblayer_compactdb_interval; /* interval to execute compact id2entry dbs */
};
diff --git a/ldap/servers/slapd/back-ldbm/ldbm_config.c b/ldap/servers/slapd/back-ldbm/ldbm_config.c
index 294999c..2092d08 100644
--- a/ldap/servers/slapd/back-ldbm/ldbm_config.c
+++ b/ldap/servers/slapd/back-ldbm/ldbm_config.c
@@ -1045,7 +1045,7 @@ static int ldbm_config_db_lock_set(void *arg, void *value, char *errorbuf, int p
if (apply) {
if (CONFIG_PHASE_RUNNING == phase) {
li->li_dblayer_private->dblayer_lock_config = val;
- LDAPDebug(LDAP_DEBUG_ANY, "New db cache size will not take affect until the server is restarted\n", 0, 0, 0);
+ LDAPDebug(LDAP_DEBUG_ANY, "New db max lock count will not take affect until the server is restarted\n", 0, 0, 0);
} else {
li->li_dblayer_private->dblayer_lock_config = val;
}
@@ -1506,7 +1506,7 @@ static config_info ldbm_config[] = {
{CONFIG_DB_VERBOSE, CONFIG_TYPE_ONOFF, "off", &ldbm_config_db_verbose_get, &ldbm_config_db_verbose_set, 0},
{CONFIG_DB_DEBUG, CONFIG_TYPE_ONOFF, "on", &ldbm_config_db_debug_get, &ldbm_config_db_debug_set, 0},
{CONFIG_DB_NAMED_REGIONS, CONFIG_TYPE_ONOFF, "off", &ldbm_config_db_named_regions_get, &ldbm_config_db_named_regions_set, 0},
- {CONFIG_DB_LOCK, CONFIG_TYPE_INT, "10000", &ldbm_config_db_lock_get, &ldbm_config_db_lock_set, 0},
+ {CONFIG_DB_LOCK, CONFIG_TYPE_INT, "10000", &ldbm_config_db_lock_get, &ldbm_config_db_lock_set, CONFIG_FLAG_ALWAYS_SHOW},
{CONFIG_DB_PRIVATE_MEM, CONFIG_TYPE_ONOFF, "off", &ldbm_config_db_private_mem_get, &ldbm_config_db_private_mem_set, 0},
{CONFIG_DB_PRIVATE_IMPORT_MEM, CONFIG_TYPE_ONOFF, "on", &ldbm_config_db_private_import_mem_get, &ldbm_config_db_private_import_mem_set, CONFIG_FLAG_ALWAYS_SHOW|CONFIG_FLAG_ALLOW_RUNNING_CHANGE},
{CONDIF_DB_ONLINE_IMPORT_ENCRYPT, CONFIG_TYPE_ONOFF, "on", &ldbm_config_db_online_import_encrypt_get, &ldbm_config_db_online_import_encrypt_set, 0},
9 years, 2 months