dbTalk Databases Forums  

Hanging CDS application

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


Discuss Hanging CDS application in the comp.databases.berkeley-db forum.



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

Default Hanging CDS application - 06-02-2006 , 08:17 AM






I was running some tests on the CDS database that I have setup. I am
using 4.4.20-4 on a debian machine (g++4.0.4)

The database is made up the main db, and 3 indices. The generated key
is a unique integer and the data is a C++ structure of variable length
similar in form to the example in the getting start guide. the flags
used when opening the ENV were "DB_CREATE | DB_INIT_CDB |
DB_INIT_MPOOL"

I have two processes.
The first process is the one that initaiizes and starts up the database
and indices. It also displays a record count in each of the dbs and
indices. This process spawns a thread that periodically removes records
in the main db based on a data value of the records. This value is
indexed.

The second process, inserts variable datalength records 1/second after
it has opened the ENV (flags = 0), db and corresponding indices (flags
= DB_UNKNOWN) .

The system deadlocks after a while.

I run db_deadlock -v -h /db
output: "db4.4_deadlock: running at Fri Jun 2 09:03:20 2006
10 lockers
Aborting locker 7"

It deadlocks soon after. And the process that is inserting the records
errors saying "Failed to insert record[594835]:: DB_LOCK_DEADLOCK:
Locker killed to resolve a deadlock". and deadlocks again.

I run the detector a couple of times and then I get a DB_RUNRECOVERY on
insert.

I have included the callstack for each of the processes (running in
gdb), along with information from db_stat pertaining to the locks.

Should I be doing things differently? Any insight would be helpful.
thanks,
danny.

Process 1: callstack
------------------------------
#0 0xb7c8c327 in select () from /lib/tls/libc.so.6
#1 0xb7f2968e in __os_sleep () from /usr/lib/libdb_cxx-4.4.so
#2 0xb7f2974d in __os_yield () from /usr/lib/libdb_cxx-4.4.so
#3 0xb7e66c31 in __db_tas_mutex_lock () from /usr/lib/libdb_cxx-4.4.so
#4 0xb7f09891 in __lock_get_internal () from /usr/lib/libdb_cxx-4.4.so
#5 0xb7f09a21 in __lock_get () from /usr/lib/libdb_cxx-4.4.so
#6 0xb7edd78a in __db_cursor () from /usr/lib/libdb_cxx-4.4.so
#7 0xb7ef0555 in __db_stat () from /usr/lib/libdb_cxx-4.4.so
#8 0xb7ef0702 in __db_stat_pp () from /usr/lib/libdb_cxx-4.4.so
#9 0xb7e5a506 in Db::stat () from /usr/lib/libdb_cxx-4.4.so
#10 0x0804db36 in AVA::AVA_Db::get_count (this=0xbff6714c, which=3,
quick=false) at AVA_Db.cc:1319



Process 2: callstack
------------------------------
Program received signal SIGINT, Interrupt.
[Switching to Thread -1228350720 (LWP 19409)]
0xb7b6c2f8 in select () from /lib/tls/libc.so.6
(gdb) bt
#0 0xb7b6c2f8 in select () from /lib/tls/libc.so.6
#1 0xb7df668e in __os_sleep () from /usr/lib/libdb_cxx-4.4.so
#2 0xb7df674d in __os_yield () from /usr/lib/libdb_cxx-4.4.so
#3 0xb7d33c31 in __db_tas_mutex_lock () from /usr/lib/libdb_cxx-4.4.so
#4 0xb7dd6891 in __lock_get_internal () from /usr/lib/libdb_cxx-4.4.so
#5 0xb7dd6a21 in __lock_get () from /usr/lib/libdb_cxx-4.4.so
#6 0xb7da38f8 in __db_c_idup () from /usr/lib/libdb_cxx-4.4.so
#7 0xb7da638b in __db_c_put () from /usr/lib/libdb_cxx-4.4.so
#8 0xb7da653e in __db_c_put () from /usr/lib/libdb_cxx-4.4.so
#9 0xb7d9f016 in __db_put () from /usr/lib/libdb_cxx-4.4.so
#10 0xb7dad27f in __db_put_pp () from /usr/lib/libdb_cxx-4.4.so
#11 0xb7d271fd in Db:ut () from /usr/lib/libdb_cxx-4.4.so
#12 0x0804a5e4 in AVA::Blackboard_Client::insert_record

db_stat output:
---------------------
db4.4_stat -c -h /db
10 Last allocated locker ID
0x7fffffff Current maximum unused locker ID
5 Number of lock modes
1000 Maximum number of locks possible
1000 Maximum number of lockers possible
1000 Maximum number of lock objects possible
13 Number of current locks
13 Maximum number of locks at any one time
10 Number of current lockers
10 Maximum number of lockers at any one time
6 Number of current lock objects
8 Maximum number of lock objects at any one time
31835 Total number of locks requested
31817 Total number of locks released
2673 Total number of locks upgraded
2680 Total number of locks downgraded
57 Lock requests not available due to conflicts, for which we
waited
0 Lock requests not available due to conflicts, for which we did
not wait
5 Number of deadlocks
0 Lock timeout value
0 Number of locks that have timed out
0 Transaction timeout value
0 Number of transactions that have timed out
352KB The size of the lock region
0 The number of region locks that required waiting (0%)

-----
db4.4_stat -Cclop -h /db
=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=
Lock REGINFO information:
Lock Region type
4 Region ID
/db/__db.004 Region name
0xa1a47000 Original region address
0xa1a47000 Region address
0xa1a9ef40 Region primary address
0 Region maximum allocation
0 Region allocated
REGION_JOIN_OK Region flags
=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=
Lock region parameters:
32775 Lock region region mutex [0/69098 0% 17715/0]
1031 locker table size
1031 object table size
351968 obj_off
343712 locker_off
1 need_dd
=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=
Lock conflict matrix:
0 0 0 0 0
0 0 1 0 0
0 1 1 1 1
0 0 0 0 0
0 0 1 0 1
=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=
Locks grouped by lockers:
Locker Mode Count Status ----------------- Object
---------------
1 dd= 9 locks held 1 write locks 0 pid/thread 16961/0
1 READ 1 HELD (c2e521d0 6264 0 0 0) handle 0
2 dd= 8 locks held 1 write locks 1 pid/thread 16961/0
2 IWRITE 1 WAIT 0x36b90 len: 20 data:
0xd0!0xe50xc2db0000000000000000000000000000
2 READ 1 WAIT 0x36b90 len: 20 data:
0xd0!0xe50xc2db0000000000000000000000000000
2 WRITE 1 HELD 0x36b48 len: 20 data:
4J0x080x84db_ttl00000000000000000000
3 dd= 7 locks held 1 write locks 0 pid/thread 16961/0
3 READ 1 HELD (84084a34 745f6264 6c74 0 0) handle
0
4 dd= 6 locks held 1 write locks 0 pid/thread 16961/0
4 READ 1 HELD (9aea15fe 6d5f6264 69686361 656e 0)
handle 0
5 dd= 5 locks held 1 write locks 0 pid/thread 16961/0
5 READ 1 HELD (aad7ce69 745f6264 657079 0 0) handle
0
6 dd= 4 locks held 1 write locks 0 pid/thread 16975/0
6 READ 1 HELD (c2e521d0 6264 0 0 0) handle 0
7 dd= 3 locks held 1 write locks 1 pid/thread 16975/0
7 READ 1 WAIT 0x36b48 len: 20 data:
4J0x080x84db_ttl00000000000000000000
7 WRITE 1 HELD 0x36b90 len: 20 data:
0xd0!0xe50xc2db0000000000000000000000000000
8 dd= 2 locks held 1 write locks 0 pid/thread 16975/0
8 READ 1 HELD (84084a34 745f6264 6c74 0 0) handle
0
9 dd= 1 locks held 1 write locks 0 pid/thread 16975/0
9 READ 1 HELD (aad7ce69 745f6264 657079 0 0) handle
0
a dd= 0 locks held 1 write locks 0 pid/thread 16975/0
a READ 1 HELD (9aea15fe 6d5f6264 69686361 656e 0)
handle 0
=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=
Locks grouped by object:
Locker Mode Count Status ----------------- Object
---------------
5 READ 1 HELD (aad7ce69 745f6264 657079 0 0) handle
0
9 READ 1 HELD (aad7ce69 745f6264 657079 0 0) handle
0

3 READ 1 HELD (84084a34 745f6264 6c74 0 0) handle
0
8 READ 1 HELD (84084a34 745f6264 6c74 0 0) handle
0

1 READ 1 HELD (c2e521d0 6264 0 0 0) handle 0
6 READ 1 HELD (c2e521d0 6264 0 0 0) handle 0

7 WRITE 1 HELD 0x36b90 len: 20 data:
0xd0!0xe50xc2db0000000000000000000000000000
2 READ 1 WAIT 0x36b90 len: 20 data:
0xd0!0xe50xc2db0000000000000000000000000000
2 IWRITE 1 WAIT 0x36b90 len: 20 data:
0xd0!0xe50xc2db0000000000000000000000000000

2 WRITE 1 HELD 0x36b48 len: 20 data:
4J0x080x84db_ttl00000000000000000000
7 READ 1 WAIT 0x36b48 len: 20 data:
4J0x080x84db_ttl00000000000000000000

4 READ 1 HELD (9aea15fe 6d5f6264 69686361 656e 0)
handle 0
a READ 1 HELD (9aea15fe 6d5f6264 69686361 656e 0)
handle 0


Reply With Quote
  #2  
Old   
Ron
 
Posts: n/a

Default Re: Hanging CDS application - 06-02-2006 , 09:58 AM






Quote:
Should I be doing things differently? Any insight would be helpful.
thanks,
danny.

Hi Danny,

You may wnat to try DB_INIT_CDB_ALLDB flag.

http://www.sleepycat.com/docs/api_c/...l#DB_CDB_ALLDB

You should not need to run a Deadlock detector with the CDS (Concurrent
Data Store).

Ron



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.