#49575 Do not crash on bad autosize values
Closed: wontfix 5 years ago by firstyear. Opened 6 years ago by maf.

Issue Description

The system is very unforgiving and if you set the nsslapd-cache-autosize to a value > 50 and do not change nsslapd-import-cache-autosize then ns-slapd refuses to start. This is kind of hard to recover from (I could not find anything simpler than changing the source).

This happens because of the check on line 112 in ldap/servers/slapd/back-ldbm/start.c stops the process completely if the sum of nsslapd-cache-autosize and nsslapd-import-cache-autosize is >100.

I think it would be better to be a bit more forgiving and just log an error and reset the sizes to their default values.

Package Version and Platform

1.3.7.5-1 on Ubuntu artful

Steps to reproduce

  1. Change the nsslapd-cache-autosize attribute in cn=config,cn=ldbm database,cn=plugins,cn=config to 60
  2. Restart ns-slapd

Actual results

It refuses to start and logs "CRIT - ldbm_back_start - Cache autosizing: bad settings, value or sum of values can not larger than 100."

Expected results


The problem is that if you set this value, and it's wrong, and we silently fall back, you don't know it went wrong.

The real issue here is that we don't display what to fix or change. This issue is a communication problem abotu the error occuring, not the actual code check,

I'll take this and will resolve it soon,

Metadata Update from @firstyear:
- Custom field component adjusted to None
- Custom field origin adjusted to None
- Custom field reviewstatus adjusted to None
- Custom field type adjusted to None
- Custom field version adjusted to None
- Issue assigned to firstyear

6 years ago

That is a good point. But how can you recover from setting a bad value? I could not find any other way than patching the source and compiling new binary.

You should fix your tuning values... You have already shown that it's the combo of import cache + autosize, so reduce one or the other,

Yes, but how? Since slapd refuses to start I am unable to use ldapmodify or any other program which talks to the server.
Is there some other tool which I am not aware of which works just against the files?

since slapd is down, you can modify dse.ldif manually, it is a text file.

Ah, I didn't find that one. I grepped in all the wrong directories.

@maf This is why I think the issue is that error message. We should communicate to you better about how to restore from this scenario.

@firstyear are you still going to look into this? I'd like to set the milestone (1.4.1?)

@mreynolds Yep, I'd be happy to look into this shortly.

Okay, it now looks like:

[08/Feb/2019:11:44:48.438807200 +1000] - CRIT - ldbm_back_start - Cache autosizing: bad settings, value or sum of values can not larger than 100.
[08/Feb/2019:11:44:48.440162500 +1000] - CRIT - ldbm_back_start - You should change nsslapd-cache-autosize + nsslapd-import-cache-autosize in dse.ldif to be less than 100.
[08/Feb/2019:11:44:48.441276700 +1000] - CRIT - ldbm_back_start - Reasonable starting values are nsslapd-cache-autosize: 20, nsslapd-import-cache-autosize: -1.
[08/Feb/2019:11:44:48.442331800 +1000] - ERR - ldbm_back_start - Failed to set database tuning on backends
[08/Feb/2019:11:44:48.443442600 +1000] - ERR - plugin_dependency_startall - Failed to start database plugin ldbm database
[08/Feb/2019:11:44:48.450085000 +1000] - ERR - slapi_reslimit_register - Parameter error (nsLookThroughLimit already registered)
[08/Feb/2019:11:44:48.451430700 +1000] - ERR - ldbm_back_start - Resource limit registration failed for lookthroughlimit

@maf Is this easier to interpret? Also I want to apologise for how long it took me to get to this ticket.

Yes, this looks better.

Great, thanks! I'm sorry it took me so long to implement this, and I hope we hear more from you in the future, this was a great bug to raise.

Metadata Update from @firstyear:
- Issue close_status updated to: fixed
- Issue status updated to: Closed (was: Open)

5 years ago

389-ds-base is moving from Pagure to Github. This means that new issues and pull requests
will be accepted only in 389-ds-base's github repository.

This issue has been cloned to Github and is available here:
- https://github.com/389ds/389-ds-base/issues/2634

If you want to receive further updates on the issue, please navigate to the github issue
and click on subscribe button.

Thank you for understanding. We apologize for all inconvenience.

Metadata Update from @spichugi:
- Issue close_status updated to: wontfix (was: fixed)

3 years ago

Login to comment on this ticket.

Metadata