dynamobi/dynamobi — Issue #458: [FNL-50] BTreeBuilder::truncate will result in an assert if it is called before an actual tree has been built
Author: dynamobi-build
Created: 2011-12-30 03:27:42+00:00
State: open
Labels: BTree, FNL

[reporter="zfong", created="Fri, 11 Aug 2006 11:28:38 -0500 (GMT-05:00)"]
While testing the new resource governor, I hit a case where the governor couldn't allocate the total min requirements for a stream graph (because I hadn't yet changed sorter to not ask for a lower min than opt), so the governor threw an exception, as I'd expect. But during exception handling, I hit an assert when BTreeBuilder::truncate got called through BTreeSortExecStream::closeImpl. Here's the excerpt of the stack trace:

#7 0xb0d66a5b in fennel::RandomAllocationSegment::translatePageId (

this=0x8381b30, pageId={val = 18446744073709551615})

at RandomAllocationSegment.cpp:393

#8 0xb11ea7aa in fennel::SegPageLock::lockPage (this=0xbfce65e4, pageId=

{val = 18446744073709551615}, lockModeInit=LOCKMODE_X,

readIfUnmapped=true) at SegPageLock.h:155

#9 0xb100a66b in fennel::SegPageLock::lockExclusive (this=0xbfce65e4, pageId=

{val = 18446744073709551615}) at SegPageLock.h:186

#10 0xb0fbfe9b in fennel::BTreeBuilder::truncate (this=0xbfce6654,

rootless=true, pLeafPageIdProj=0x0) at BTreeBuilder.cpp:359

#11 0xb1051b94 in fennel::BTreeSortExecStream::truncateTree (this=0x8657f80,

rootless=true) at BTreeSortExecStream.cpp:115

#12 0xb1051c2a in fennel::BTreeSortExecStream::closeImpl (this=0x8657f80)

at BTreeSortExecStream.cpp:124

#13 0xb0c7f593 in fennel::ClosableObject::close (this=0x86580a0)

at ClosableObject.cpp:45

The assert occurs, I assume, because BTreeBuilder::truncate() tries to lock NULL_PAGE_ID since the exception occurs before any real work has been done on the stream, and therefore, there is no btree yet.

I don't have a "real" testcase since it depends on code that's still in development, but hopefully this description provides enough context on the problem.