RHEL Engineering is moving the tracking of its product development work on RHEL 6 through RHEL 9 to Red Hat Jira (issues.redhat.com). If you're a Red Hat customer, please continue to file support cases via the Red Hat customer portal. If you're not, please head to the "RHEL project" in Red Hat Jira and file new tickets here. Individual Bugzilla bugs in the statuses "NEW", "ASSIGNED", and "POST" are being migrated throughout September 2023. Bugs of Red Hat partners with an assigned Engineering Partner Manager (EPM) are migrated in late September as per pre-agreed dates. Bugs against components "kernel", "kernel-rt", and "kpatch" are only migrated if still in "NEW" or "ASSIGNED". If you cannot log in to RH Jira, please consult article #7032570. That failing, please send an e-mail to the RH Jira admins at rh-issues@redhat.com to troubleshoot your issue as a user management inquiry. The email creates a ServiceNow ticket with Red Hat. Individual Bugzilla bugs that are migrated will be moved to status "CLOSED", resolution "MIGRATED", and set with "MigratedToJIRA" in "Keywords". The link to the successor Jira issue will be found under "Links", have a little "two-footprint" icon next to it, and direct you to the "RHEL project" in Red Hat Jira (issue links are of type "https://issues.redhat.com/browse/RHEL-XXXX", where "X" is a digit). This same link will be available in a blue banner at the top of the page informing you that that bug has been migrated.
Bug 1773115 - bdb_start - Detected Disorderly Shutdown last time Directory Server was running
Summary: bdb_start - Detected Disorderly Shutdown last time Directory Server was running
Keywords:
Status: CLOSED ERRATA
Alias: None
Product: Red Hat Enterprise Linux 8
Classification: Red Hat
Component: 389-ds-base
Version: 8.2
Hardware: Unspecified
OS: Unspecified
unspecified
unspecified
Target Milestone: rc
: 8.0
Assignee: mreynolds
QA Contact: RHDS QE
URL:
Whiteboard:
Depends On:
Blocks: 1788322 1790979
TreeView+ depends on / blocked
 
Reported: 2019-11-15 22:46 UTC by Viktor Ashirov
Modified: 2020-09-13 22:24 UTC (History)
6 users (show)

Fixed In Version: 389-ds-base-1.4.2.4-7.module+el8.2.0+5670+0b8b1c2e
Doc Type: If docs needed, set a value
Doc Text:
Clone Of:
Environment:
Last Closed: 2020-04-28 16:01:22 UTC
Type: Bug
Target Upstream Version:
Embargoed:
mreynolds: mirror+


Attachments (Terms of Use)


Links
System ID Private Priority Status Summary Last Updated
Github 389ds 389-ds-base issues 3796 0 None closed bdb_start - Detected Disorderly Shutdown last time Directory Server was running 2021-01-11 17:02:11 UTC
Red Hat Product Errata RHBA-2020:1703 0 None None None 2020-04-28 16:01:43 UTC

Description Viktor Ashirov 2019-11-15 22:46:22 UTC
Description of problem:
In a lot of test cases I see the following error in the logs:
NOTICE - bdb_start - Detected Disorderly Shutdown last time Directory Server was running

Version-Release number of selected component (if applicable):
389-ds-base-1.4.2.4-3.module+el8.2.0+4718+1b57dca2.x86_64.rpm


How reproducible:
always

Steps to Reproduce:
1. Run tests/suites/plugins/acceptance_test.py
2.
3.

Actual results:
The error about disorderly shutdown is logged 

Expected results:
There shouldn't be a disorderly shutdown.

Additional info:

Comment 1 thierry bordaz 2019-11-18 11:29:59 UTC
The problem can be reproduced when DS fails to start (e.g. if one plugin is not started because of missing dependency), next sucessful start bdb_start is called with a bdb_recovery_required that triggers the message: Detected Disorderly Shutdown.
I am not sure it is required to run a db recovery at that time as the database has been closed properly.

Comment 2 Ludwig 2019-11-18 12:06:39 UTC
(In reply to thierry bordaz from comment #1)
> The problem can be reproduced when DS fails to start (e.g. if one plugin is
> not started because of missing dependency), next sucessful start bdb_start
> is called with a bdb_recovery_required that triggers the message: Detected
> Disorderly Shutdown.
> I am not sure it is required to run a db recovery at that time as the
> database has been closed properly.

I thought the message is logged at a restart after import, thought that the offline import was tampering with the guardian file

Comment 3 Ludwig 2019-11-18 12:11:12 UTC
And I think it is because of the removed dblayer_close() by #50659

Comment 4 thierry bordaz 2019-11-18 14:00:13 UTC
It is possibly related to 50659 but then I am missing something.
During plugin_dependency_startall, it starts dependencies (dblayer_start) but if a dependency is missing (testcase) it just call exit (without calling plugin_closeall) so guardian is not written.
If I understand correctly 50659 it only removes dblayer_close during import.

Comment 5 Ludwig 2019-11-18 14:12:59 UTC
(In reply to thierry bordaz from comment #4)
> It is possibly related to 50659 but then I am missing something.
> During plugin_dependency_startall, it starts dependencies (dblayer_start)
> but if a dependency is missing (testcase) it just call exit (without calling
> plugin_closeall) so guardian is not written.

but this might be ok, is it new ? Or maybe we are talking about two different test scenarios. If I run tests/suites/plugins/acceptance_test.py::test_acctpolicy I do not see any plugin error, but before 50659 I do not see the disorderly shutdown

> If I understand correctly 50659 it only removes dblayer_close during import.

yes, and in most test cases there is an import during setup

Comment 6 thierry bordaz 2019-11-18 14:25:35 UTC
I have a doubt that it is new (related to 50659).
If guardian file (i.e. dblayer_close) is not created, next restart will log 'Detected Disorderly Shutdown' because 'read_metadata' detects a need of recovery.

In the following scenario, plugin_dependency_startall exits without calling dblayer_close. I wonder if it was the case, even before backend refactoring.
dn: cn=account usability plugin,cn=plugins,cn=config
nsslapd-plugin-depends-on-named: attribute uniqueness                                                                                              

dn: cn=attribute uniqueness,cn=plugins,cn=config
nsslapd-pluginEnabled: off

Comment 7 Ludwig 2019-11-18 15:01:37 UTC
You are probably right. And there is a potential link to #50659

Usually import does not check and write the guardian file. So if your server fails and does not write a guardian file, before +50659 the additional dblayer_close would have written the guardian file if just an import was run after the failure. So this was probably exposed with the removal of dblayer_close() - 
but I am not really sure about it

Comment 8 thierry bordaz 2019-11-26 10:20:00 UTC
Upstream ticket:
https://pagure.io/389-ds-base/issue/50741

Comment 9 thierry bordaz 2019-11-27 16:38:19 UTC
Fix pushed upstream

Comment 14 errata-xmlrpc 2020-04-28 16:01:22 UTC
Since the problem described in this bug report should be
resolved in a recent advisory, it has been closed with a
resolution of ERRATA.

For information on the advisory, and where to find the updated
files, follow the link below.

If the solution does not work for you, open a new bug report.

https://access.redhat.com/errata/RHBA-2020:1703


Note You need to log in before you can comment on or make changes to this bug.