dbTalk Databases Forums  

WAS_WRITE lock leaking with DB_DIRTY_READ & DB_AUTO_COMMIT turn on

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


Discuss WAS_WRITE lock leaking with DB_DIRTY_READ & DB_AUTO_COMMIT turn on in the comp.databases.berkeley-db forum.



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

Default WAS_WRITE lock leaking with DB_DIRTY_READ & DB_AUTO_COMMIT turn on - 07-16-2006 , 07:48 PM






Hi, I has a hash based berkeley db (4.4) with DB_AUTO_COMMIT on
and it works fine. But once I turned on both DB_DIRTY_READ
and DB_AUTO_COMMIT, it generates a WAS_WRITE lock after every
DB->put() operation without releasing it. So after a while, it
ran out of all locks (default 64K) and reached error of
"BERKELEY DB: Lock table is out of available object entries".

I didn't generate any transaction explicitly in my application.
I didn't make any DB->get() or cursor call. I didn't share
the db with other process. The txn_stat output
didn't show any transaction holding those WAS_WRITE locks.
If I removed DB_DIRTY_READ in the open() call, this lock
leaking problem is gone.

Any idea why the db is holding WAS_WRITE lock after the
DB->put() is done ? How can I find out which transaction
is holding those locks ? Thanks in advanced. - John


Here the db create code: --------------------
rc = db_env->open( db_env,
my_home,
DB_CREATE |
DB_INIT_LOCK |
DB_INIT_LOG |
DB_INIT_TXN |
DB_INIT_MPOOL |
DB_PRIVATE ,
0 );


rc = db->open(db, NULL, my_file_name, NULL, DB_HASH, DB_CREATE,
DB_PERMS);
db->close(db, 0);


Here db open code: -----------------------
rc = db_env->set_flags(db_env, DB_AUTO_COMMIT, 1);

rc = my_db->open( db_env,
NULL, /*txn*/
my_file_name,
NULL,
DB_UNKNOWN,
DB_THREAD , DB_DIRTY_READ,
0664 );


Here's the lock_stat output: ---------------


Default locking region information:
3 Last allocated locker ID
0x7fffffff Current maximum unused locker ID
9 Number of lock modes
65536 Maximum number of locks possible
128 Maximum number of lockers possible
65536 Maximum number of lock objects possible
6 Number of current locks
7 Maximum number of locks at any one time
2 Number of current lockers
2 Maximum number of lockers at any one time
6 Number of current lock objects
7 Maximum number of lock objects at any one time
114 Total number of locks requested
108 Total number of locks released
0 Total number of locks upgraded
1 Total number of locks downgraded
0 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
0 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
13MB 152KB The size of the lock region
0 The number of region locks that required waiting (0%)
=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=
Lock REGINFO information:
Lock Region type
5 Region ID
/db/1/__db.005 Region name
0xbe3cad0 Original region address
0xbe3cad0 Region address
0xbe3cb28 Region primary address
13787136 Region maximum allocation
13787136 Region allocated
REGION_CREATE, REGION_CREATE_OK, REGION_JOIN_OK Region flags
=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=
Lock region parameters:
2062 Lock region region mutex [0/241 0% 12274/3076336544]
131 locker table size
65537 object table size
199554752 obj_off
199478360 locker_off
0 need_dd
=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=
Lock conflict matrix:
0 0 0 0 0 0 0 0 0

0 0 1 0 1 0 1 0 1

0 1 1 1 1 1 1 1 1

0 0 0 0 0 0 0 0 0

0 1 1 0 0 0 0 1 1

0 0 1 0 0 0 0 0 1

0 1 1 0 0 0 0 1 1

0 0 1 0 1 0 1 0 0

0 1 1 0 1 1 1 0 1

=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=
Locks grouped by lockers:
Locker Mode Count Status ----------------- Object
---------------
2 dd= 0 locks held 1 write locks 0 pid/thread
12274/3086829760
2 READ 1 HELD my_test.db4.4 handle
0
3 dd= 0 locks held 5 write locks 5 pid/thread
12274/3065846688
3 WAS_WRITE 1 HELD my_test.db4.4 page
83096
3 WAS_WRITE 1 HELD my_test.db4.4 page
62334
3 WAS_WRITE 1 HELD my_test.db4.4 page
24944
3 WAS_WRITE 1 HELD my_test.db4.4 page
28650
3 WAS_WRITE 1 HELD my_test.db4.4 page
72029
=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=
Locks grouped by object:
Locker Mode Count Status ----------------- Object
---------------
3 WAS_WRITE 1 HELD my_test.db4.4 page
24944

3 WAS_WRITE 1 HELD my_test.db4.4 page
28650

3 WAS_WRITE 1 HELD my_test.db4.4 page
83096

3 WAS_WRITE 1 HELD my_test.db4.4 page
72029

2 READ 1 HELD my_test.db4.4 handle
0

3 WAS_WRITE 1 HELD my_test.db4.4 page
62334



Here is the txn_stat output -----------------


Default transaction region information:
1/68944 File/offset for last checkpoint LSN
Sun Jul 16 14:22:24 2006 Checkpoint timestamp
0x80000000 Last transaction ID allocated
20 Maximum number of active transactions configured
0 Active transactions
0 Maximum active transactions
0 Number of transactions begun
0 Number of transactions aborted
0 Number of transactions committed
0 Number of transactions restored
16KB Transaction region size
0 The number of region locks that required waiting (0%)
Active transactions:
=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=
Transaction REGINFO information:
Transaction Region type
6 Region ID
/db/1/__db.006 Region name
0xab455c0 Original region address
0xab455c0 Region address
0xab45618 Region primary address
16384 Region maximum allocation
16384 Region allocated
REGION_CREATE, REGION_CREATE_OK, REGION_JOIN_OK Region flags
=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=
DB_TXNMGR handle information:
2065 DB_TXNMGR mutex [0/0 0% !Own]
0 Number of transactions discarded
=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=
DB_TXNREGION handle information:
2063 DB_TXNREGION region mutex [0/9 0% 10783/3076389792]
20 Maximum number of active txns
0x80000000 Last transaction ID allocated
0xffffffff Current maximum unused ID
2064 checkpoint mutex [0/2 0% !Own]
1/68944 Last checkpoint LSN
Sun Jul 16 14:22:24 2006 Last checkpoint timestamp
Flags
=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=
XA information:
0 XA RMID


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

Default Re: WAS_WRITE lock leaking with DB_DIRTY_READ & DB_AUTO_COMMIT turn on - 07-17-2006 , 12:04 PM







Quote:
rc = my_db->open( db_env,
NULL, /*txn*/
my_file_name,
NULL,
DB_UNKNOWN,
DB_THREAD , DB_DIRTY_READ,
0664 );


Not sure if this is the problem, but the first parameter to DB->open is
the database handle not the environment handle.

Michael Ubell
Sleepycat Software.



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

Default Re: WAS_WRITE lock leaking with DB_DIRTY_READ & DB_AUTO_COMMIT turn on - 07-17-2006 , 09:40 PM



Thanks for the update. That actual code is using db handle and the
program does work
for 64k put() calls. But in order to make the post shorter, I replaced
the original long db handle with the wrong typing.

Mike wrote:
Quote:
Not sure if this is the problem, but the first parameter to DB->open is
the database handle not the environment handle.


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.