[Date Prev][Date Next] [Chronological] [Thread] [Top]

Re: (ITS#7829) MDB mdb_cursor_del causes records to be skipped



Sorry, forgot the crash info.

mdb.c:7419: Assertion 'NUMKEYS(mc->mc_pg[ptop]) > 1' failed in mdb_rebalance()

(gdb) p *mc->mc_pg[ptop]
$1 = {
  mp_p = {p_pgno = 24, p_next = 0x18}, mp_pad = 0, mp_flags = 17, 
  mp_pb = {pb = {pb_lower = 18, pb_upper = 1016}, pb_pages = 66584594}, 
  mp_ptrs = {1016}
}
(gdb) info locals
node = 0x0
rc = -268443168
ptop = 0
minkeys = 1
mn = {
  mc_next = 0x7ffff5ce0010, mc_backup = 0x7fffe41013a0, mc_xcursor = 0x0, 
  mc_txn = 0x7fffe42c9700, mc_dbi = 6, mc_db = 0x7fffe42c9890, 
  mc_dbx = 0x7fffe42c3fb0, mc_dbflag = 0x7fffe42c3fb0 "\002", 
  mc_snum = 2, mc_top = 1, mc_flags = 65, 
  mc_pg = {0x7fffe4102840, 0x7fffe8109670, 0x2efffe300, 0x7fffefffe0c0, 0x7fffefffe0a0, 0x7fffefffe2c0, 
    0x7fffefffe2c0, 0x53e7cd, 0x7fffefffe1c0, 0x7fffe40019f0, 0x7fffe41013a0, 0x7fffefffe2c0, 0x30c3669909, 
    0xfbad8001, 0x7fffefffe2c0, 0x7fffefffe2c0, 0x7fffefffe2c0, 0x7fffefffe130, 0x7fffefffe2d0, 0x7fffefffe180, 
    0x49c7ca, 0x7fffefffe140, 0x7fffefffe1dc, 0x1100000000, 0x0, 0x7fffefffe2d0, 0x7fffe4101528, 0x7fffefffe180, 0x1, 
    0x7fffe81099d4, 0x7fffefffe260, 0x100000008}, 
  mc_ki = {5416, 58384, 32767, 0, 39380, 59408, 32767, 0, 39364, 59408, 32767, 0, 39400, 59408, 32767, 0, 39332, 
    59408, 32767, 0, 68, 0, 0, 0, 15369, 50024, 48, 0, 57792, 61439, 32767, 0}
}
oldki = 0
__FUNCTION__ = "mdb_rebalance"
(gdb) p *mc
$2 = {
  mc_next = 0x0, mc_backup = 0x0, mc_xcursor = 0x7fffe4101528, 
  mc_txn = 0x7fffe42c9700, mc_dbi = 6, mc_db = 0x7fffe42c9890,
  mc_dbx = 0x7fffe42c3fb0, mc_dbflag = 0x7fffe42cb3e6 "\t\n\n", 
  mc_snum = 2, mc_top = 1, mc_flags = 65, 
  mc_pg = {0x7fffe4102840, 0x7fffe8109670, 0x0, 0x40, 0x44, 0x0, 0x6a206e616d726568, 0x6f65703d756f2c72, 
    0x653d63642c656c70, 0x642c656c706d6178, 0x302e006d6f633d63, 0x30235a3632353631, 0x2d1, 0x7fffe4000338, 0x81, 
    0x7fffe4102c40, 0x7fffe42c7860, 0x20, 0x64, 0x0, 0x4, 0x1a, 0x19, 0x10, 0xe, 0xd, 0xb, 0xa, 0x9, 0x140, 0x84, 
    0x0}, 
  mc_ki = {0, 5, 0, 0, 22160, 63214, 32767, 0, 32769, 0, 0, 0, 64592, 70, 0, 0, 22160, 63214, 32767, 0, 32775, 0, 0, 
    0, 63424, 70, 0, 0, 22160, 63214, 32767, 0}
}

Backtrace:
#2  mdb_assert_fail ()
#3  mdb_rebalance (mc=0x7fffe41013a0) at mdb.c:7419
#4  mdb_cursor_del0 (mc=0x7fffe41013a0) at mdb.c:7496
#5  mdb_cursor_del (mc=0x7fffe41013a0, flags=0) at mdb.c:6360
#6  mdb_idl_delete_keys (be, cursor=0x7fffe41013a0, keys, id=7) at idl.c:608
#7  indexer (op=0x7fffe4000950, txn, ai, ad=0x838180, atname=0x837fc8, vals=0x7fffe40019f0, id=7, opid=2, mask=1814) at index.c:258
#8  index_at_values (op=0x7fffe4000950, txn=0x7fffe42c9700, ad, type=0x837f60, tags=0x8381a0, vals=0x7fffe40019f0, id=7, opid=2) at index.c:337
#9  mdb_index_values (op, txn, desc, vals, id, opid) at index.c:386
#10 mdb_index_entry (op=0x7fffe4000950, txn=0x7fffe42c9700, opid=2, e=0x7fffe40017d0) at index.c:558
#11 mdb_delete (op=0x7fffe4000950, rs=0x7fffefffe910) at delete.c:347
#12 overlay_op_walk (op=0x7fffe4000950, rs=0x7fffefffe910, which=op_delete, oi=0x7fffe81036a0, on=0x0) at backover.c:671
#13 over_op_func (op=0x7fffe4000950, rs, which) at backover.c:723
#14 fe_op_delete (op=0x7fffe4000950, rs=0x7fffefffe910) at delete.c:174
#15 do_delete (op=0x7fffe4000950, rs=0x7fffefffe910) at delete.c:95
#16 connection_operation (ctx=0x7fffefffea70, arg_v=0x7fffe4000950) at connection.c:1155
#17 connection_read_thread (ctx=0x7fffefffea70, argv) at connection.c:1291
#18 ldap_int_thread_pool_wrapper (xpool=0x83b3b0) at tpool.c:688

Test output:
Running ldapadd to build slapd config database...
Running ldapadd to build slapd database...
Search the entire database...
Running ldapmodify to add a member...
Re-search the entire database...
Running ldapmodify to rename a member...
Re-search the entire database...
Running ldapmodify to rename a group...
Re-search the entire database...
Running ldapmodify to add self...
Re-search the entire database...
Running ldapdelete to remove a member...
Re-search the entire database...
Running ldapdelete to remove a group...
Re-search the entire database...
Adding groups with MAY member type schemas...

Log ends with:
533898e1 => index_entry_del( 7, "cn=Jessica Rabbit,ou=People,dc=example,dc=com" )
533898e1 mdb_idl_delete_keys: 7 [860433ad]
533898e1 mdb_idl_delete_keys: 7 [00000000]
533898e1 mdb_idl_delete_keys: 7 [aaacba45]
533898e1 mdb_idl_delete_keys: 7 [e10d2617]

-- 
Hallvard