dbTalk Databases Forums  

is_alive example

comp.databases.berkeley-db comp.databases.berkeley-db


Discuss is_alive example in the comp.databases.berkeley-db forum.



Reply
 
Thread Tools Display Modes
  #1  
Old   
steve
 
Posts: n/a

Default is_alive example - 12-10-2005 , 10:49 AM






Hi,

I have an application structure where there is a long running server
(multi-fork processes), with a few admin processes started periodically
by cron which all share the same single Berkeley DB environment (with
very many DB's in this environment).

I'm trying to use is_alive and failchk from a dedicated "watchdog"
process to handle forks dying with locks held. I'm getting
"is_alive method specified but no thread region allocated"
whenever I call DBENV->set_isalive(). I'm not sure what this error
means. I've even tried using DB_THREAD during environment and db
init/open, but that doesn't help either.

Has anyone managed to get is_alive and failchk working or can anyone
share some working example code?
I really don't want to be looking at using DB_REGISTER. From what I can
understand of the docs, the DB_REGISTER method seems to be more suited
to serializing recovery rather than being able to determine (by polling
failchk) whether recovery needs to be performed.

TIA.

Steve.

Reply With Quote
  #2  
Old   
luca.faustin@ibttn.it
 
Posts: n/a

Default Re: is_alive example - 12-12-2005 , 02:56 AM







steve wrote:
Quote:
Hi,

I have an application structure where there is a long running server
(multi-fork processes), with a few admin processes started periodically
by cron which all share the same single Berkeley DB environment (with
very many DB's in this environment).

I'm trying to use is_alive and failchk from a dedicated "watchdog"
process to handle forks dying with locks held. I'm getting
"is_alive method specified but no thread region allocated"
whenever I call DBENV->set_isalive(). I'm not sure what this error
means. I've even tried using DB_THREAD during environment and db
init/open, but that doesn't help either.

You have to call the function "dbenv->set_thread_count(dbenv,
num_of_threads )" before opening the environment. "num_of_threads" must
be greater than 8.

ciao, Luca

Quote:
Has anyone managed to get is_alive and failchk working or can anyone
share some working example code?
I really don't want to be looking at using DB_REGISTER. From what I can
understand of the docs, the DB_REGISTER method seems to be more suited
to serializing recovery rather than being able to determine (by polling
failchk) whether recovery needs to be performed.

TIA.

Steve.


Reply With Quote
  #3  
Old   
john
 
Posts: n/a

Default Re: is_alive example - 12-13-2005 , 10:14 AM



luca.faustin (AT) ibttn (DOT) it wrote:
Quote:
You have to call the function "dbenv->set_thread_count(dbenv,
num_of_threads )" before opening the environment. "num_of_threads" must
be greater than 8.

ciao, Luca
Thanks Luca,

I went through the source code for dbenv->set_thread_count() and it
seems the number of threads needs to be a minimum of 8 just to satisfy
dbenv->thr_nbucket being non-zero. When dbenv->thr_nbucket == 0, it will
throw the "is_alive method specified but no thread region allocated".

So it appears to work, but there is no documentation and it all seems
like voodoo to me. Is there any documentation on the impact of setting
the thread count? For my purposes, I'm not using multithreads. I'm just
using multi-forks.

TIA.
Steve.


Reply With Quote
Reply




Thread Tools
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

vB code is On
Smilies are On
[IMG] code is On
HTML code is Off



Powered by vBulletin Version 3.5.3
Copyright ©2000 - 2012, Jelsoft Enterprises Ltd.