Commit 92159be5 authored by unknown's avatar unknown
Browse files

bug#16495 - ndb dd - dict ref count was not correctly set after SR


storage/ndb/src/kernel/blocks/dbdict/Dbdict.cpp:
  Add dump for object/ref count
  Fix ref count on SR
parent 9ea27d32
Loading
Loading
Loading
Loading
+24 −8
Original line number Diff line number Diff line
@@ -287,6 +287,20 @@ Dbdict::execDUMP_STATE_ORD(Signal* signal)
    MEMINFO("c_rope_pool", c_rope_pool);
  }

  if (signal->theData[0] == 1227)
  {
    DLHashTable<DictObject>::Iterator iter;
    bool ok = c_obj_hash.first(iter);
    for(; ok; ok = c_obj_hash.next(iter))
    {
      Rope name(c_rope_pool, iter.curr.p->m_name);
      const Uint32 size = name.size();
      char buf[1024];
      name.copy(buf);
      ndbout_c("%s m_ref_count: %d", buf, iter.curr.p->m_ref_count); 
    }
  }    
  
  return;
}//Dbdict::execDUMP_STATE_ORD()

@@ -5080,13 +5094,6 @@ Dbdict::createTab_prepare(Signal* signal, CreateTabReq * req){
    safe_cast(&Dbdict::createTab_writeSchemaConf1);
  
  updateSchemaState(signal, tableId, &tabEntry, &callback);

  if (tabPtr.p->m_tablespace_id != RNIL)
  {
    FilegroupPtr ptr;
    ndbrequire(c_filegroup_hash.find(ptr, tabPtr.p->m_tablespace_id));
    increase_ref_count(ptr.p->m_obj_ptr_i);
  }
}

void getSection(SegmentedSectionPtr & ptr, Uint32 i);
@@ -6231,6 +6238,15 @@ void Dbdict::handleTabInfo(SimpleProperties::Reader & it,
    {
      tabRequire(false, CreateTableRef::InvalidTablespaceVersion);
    }

    {
      /**
       * Increase ref count
       */
      FilegroupPtr ptr;
      ndbrequire(c_filegroup_hash.find(ptr, tablePtr.p->m_tablespace_id));
      increase_ref_count(ptr.p->m_obj_ptr_i);
    }
  }
}//handleTabInfo()