Bug 240897 - CRM 1474928 : ds7.1 db index/vlv not handling a stop-slapd, hangs slapd
CRM 1474928 : ds7.1 db index/vlv not handling a stop-slapd, hangs slapd
Status: CLOSED CURRENTRELEASE
Product: Red Hat Directory Server
Classification: Red Hat
Component: Database - Indexes/Searches (Show other bugs)
7.1
All Linux
high Severity high
: DS8.0
: ---
Assigned To: Noriko Hosoi
Viktor Ashirov
:
Depends On:
Blocks: 240316
  Show dependency treegraph
 
Reported: 2007-05-22 14:15 EDT by Issue Tracker
Modified: 2016-05-06 10:39 EDT (History)
5 users (show)

See Also:
Fixed In Version:
Doc Type: Bug Fix
Doc Text:
Story Points: ---
Clone Of:
Environment:
Last Closed: 2016-05-06 10:39:48 EDT
Type: ---
Regression: ---
Mount Type: ---
Documentation: ---
CRM:
Verified Versions:
Category: ---
oVirt Team: ---
RHEL 7.3 requirements from Atomic Host:
Cloudforms Team: ---


Attachments (Terms of Use)
cvs diffs (13.25 KB, patch)
2007-09-19 20:43 EDT, Noriko Hosoi
no flags Details | Diff
cvs diff libglobs.c (756 bytes, patch)
2007-09-20 12:50 EDT, Noriko Hosoi
no flags Details | Diff
cvs commit message (1.96 KB, text/plain)
2007-09-20 12:55 EDT, Noriko Hosoi
no flags Details

  None (edit)
Description Issue Tracker 2007-05-22 14:15:56 EDT
Escalated to Bugzilla from IssueTracker
Comment 11 Rich Megginson 2007-06-04 12:50:12 EDT
(In reply to comment #10)
> BZ Comment #4 Step #8
> 
> Anhy idea why the indexing hung at this stage? I believe this was the root
> cause of all prblems that happened with Hyperion Solutions. It would comes
> as below.

It would seem that there is a bug with creating a browsing index on-line.

> 
> - One admin ran browsing index.
> - It hung. Don't know the reason for the hang, but it's clear from Step
> #8 of Comment #4 that indexing may hang due to "some" reasons.
> - Another admin found database in read-only mode. (At Hyperion more than
> one person has admin access, I guess)
> - Unchecked it. Didn't help. Killed it. Indexing got corruped and found
> an OU missing.
> 
> I see the possibility for another bugzilla which could come from Step #8
> of comment #4.
> 
> Thought?

Yes.  The server should listen for close events and respond.  It seems that in
this case indexing does not respond to the close event.

> 
> --Sadique
> 
> Version set to: '7.1'
> 
> This event sent from IssueTracker by sputhenp 
>  issue 121430
>               

Comment 15 Noriko Hosoi 2007-09-19 20:43:51 EDT
Created attachment 200321 [details]
cvs diffs

Problem analysis:
[..] - Waiting for 4 database threads to stop
[..] - All database threads now stopped
[..] - libdb: DB_TXN->abort: Log undo failed for LSN: 3
1282125: No such file or directory
[..] - libdb: PANIC: No such file or directory
[..] - libdb: Unable to abort transaction 0x8000004b: DB_RUNRECOVERY: Fatal
error, run database recovery
[..] - libdb: PANIC: DB_RUNRECOVERY: Fatal error, run database recovery
[..] - libdb: Error: closing the transaction region with active transactions
[..] - slapd stopped.
Browsing index creation is implemented using task, which spawns a dedicated
task thread to do the task (index creation in this case).  When shutting down,
the server counts the active thread count and when it reaches 0, it closes the
backend db.  The problem here was the task threads were not counted in the
active thread count.  Therefore, the server closed the backend db while the
reindex task thread was still accessing the db index file.

Fix description:
1. moved active thread count from ns-slapd to libslapd for the task threads to
use.
2. provided APIs to increment/decrement/get the active thread count
3. let task threads increment the active thread count when it's spawned and
decrement it when it quits.

Files: ldapserver/ldap/server/slapd/
	    libglobs.c, configdse.c, conntable.c
	    proto-slap.h, connection.c, daemon.c
	    task.c, monitor.c, psearch.c
	    fe.h, globals.c
Comment 16 Rich Megginson 2007-09-19 21:58:42 EDT
I think active_threads needs to be PRInt32 and it should be static.  I think you
can cast it to int in g_decr_active_threadcnt()
Comment 17 Noriko Hosoi 2007-09-20 12:50:57 EDT
Created attachment 200931 [details]
cvs diff libglobs.c

(In reply to comment #16)
> I think active_threads needs to be PRInt32 and it should be static.  I think
you
> can cast it to int in g_decr_active_threadcnt()
Thank you for your comments, Rich.  I've updated libglobs.c.

And this is the correct file list:
Files: ldapserver/ldap/server/slapd/
	    libglobs.c,
	    proto-slap.h, connection.c, daemon.c
	    task.c, monitor.c, psearch.c
	    fe.h, globals.c
Comment 18 Noriko Hosoi 2007-09-20 12:55:33 EDT
Created attachment 200941 [details]
cvs commit message

Reviewed by Rich (Thank you!)

Checked in into HEAD.

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