Description
This Python test script tries to abort because we're unlocking a lock that was never acquired.
import wiredtiger, wttest
|
|
class test_f(wttest.WiredTigerTestCase):
|
# This test drops core.
|
def test_f(self):
|
uri = "table:xxx"
|
self.session.create(uri,
|
'key_format=i,value_format=SiS,' +
|
'columns=(record,column2,column3,column4),' +
|
'colgroups=(cgroup1,cgroup2,cgroup3)')
|
cgname = 'colgroup:' + uri.split(":")[1]
|
self.session.create(cgname + ':cgroup1', 'columns=(column2)')
|
self.session.create(cgname + ':cgroup2', 'columns=(column3)')
|
self.session.create(cgname + ':cgroup3', 'columns=(column4)')
|
indxname = 'index:' + uri.split(":")[1]
|
self.session.create(indxname + ':indx1', 'columns=(column2)')
|
self.session.truncate(uri, None, None, None)
|
self.session.drop(uri, None)
|
|
if __name__ == '__main__':
|
wttest.run()
|
The problem is we're not acquiring a lock when opening the btree handle. Here's the stack to get the btree handle:
#0 __wt_session_get_btree (session=0x8030de3d0, uri=0x801012ec0 "file:xxx_indx1.wti", cfg=0x0,
|
flags=2) at ../src/session/session_btree.c:178
|
WT-1 0x0000000801ec533e in __open_index (session=0x8030de3d0, table=0x800f87600,
|
uri=0x800ea7b08 "index:xxx:indx1",
|
idxconf=0x8010d5190 "columns=(column2),filename=xxx_indx1.wti")
|
at ../src/schema/schema_open.c:172
|
WT-2 0x0000000801ec5966 in __wt_schema_open_index (session=0x8030de3d0, table=0x800f87600,
|
idxname=0x0, len=0) at ../src/schema/schema_open.c:305
|
WT-3 0x0000000801ecbbbb in __truncate_table (session=0x8030de3d0, name=0x8030c117a "xxx")
|
at ../src/schema/schema_truncate.c:68
|
WT-4 0x0000000801ecbd99 in __wt_schema_truncate (session=0x8030de3d0, uri=0x8030c1174 "table:xxx",
|
cfg=0x7fffffffc6a0) at ../src/schema/schema_truncate.c:114
|
WT-5 0x0000000801ecd53f in __session_truncate (wt_session=0x8030de3d0,
|
uri=0x8030c1174 "table:xxx", start=0x0, stop=0x0, config=0x0)
|
at ../src/session/session_api.c:331
|
I believe the problem is encapsulated in *open_index: early in the function we call *wt_session_get_btree() but which doesn't lock the btree's rwlock, and then at the end of the function we call __wt_session_release_btree which always attempts to unlock btree->rwlock.