dbTalk Databases Forums  

DB_NOLOCKING use in production

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


Discuss DB_NOLOCKING use in production in the comp.databases.berkeley-db forum.



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

Default DB_NOLOCKING use in production - 02-07-2008 , 04:01 AM






Hi,

I have an application which uses a Berkeley DB in concurrent data store
mode via the Perl bindings. There are multiple processes accessing the
database, but they write only infrequently so I can live with the
limitation of only having 1 writer at a time.

Each process calls set_isalive and failchk after opening the environment
and recovers with a private environment if DB_RUNRECOVER is returned
before going on to open the database.

However, I occasionally get a hang when a new process tries to
open/join the environment, especially if a previous process has quit
unexpectedly. Working around this seems a bit chicken and egg, as I
need to open the environment before I can failchk it.

Once this hang has occurred, all the db utilities also hang accessing
the environment, so it appears there is some sort of deadlock.

I don't want to recover every time a process starts as it will hose any
other running processes.

I have come up with a solution which I would like your thoughts on:
First open an environment with DB_NOLOCKING and failchk/recover as
required. This gets round the hang (which is presumably mutex related).
Finally open an environment to use for the application without
DB_NOLOCKING.

I notice the docs say DB_NOLOCKING is for debugging only. Does anyone
have thoughts on is use in this scenario? Or is there another way around
this issue that I have not thought of?

Many thanks,

Mark

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.