Commit 9d3eb243 authored by Bradley C. Kuszmaul's avatar Bradley C. Kuszmaul

Please run the test case under the debugger (compiled with -O0), and then in...

Please run the test case under the debugger (compiled with -O0), and then in gdb when it bombs do the following commands.

{{{
(gdb) print original_mp
(gdb) print last_total_size_needed
(gdb) up
(gdb) print *mp
(gdb) where
}}}


Addresses #880. 


git-svn-id: file:///svn/tokudb@4255 c7de825b-a66e-492c-adef-691d508d4ae1
parent 203c925d
...@@ -3334,9 +3334,13 @@ static int move_it (OMTVALUE lev, u_int32_t idx, void *v) { ...@@ -3334,9 +3334,13 @@ static int move_it (OMTVALUE lev, u_int32_t idx, void *v) {
return 0; return 0;
} }
u_int32_t last_total_size_needed;
struct mempool original_mp;
// Compress things, and grow the mempool if needed. // Compress things, and grow the mempool if needed.
static int omt_compress_kvspace (OMT omt, struct mempool *memp, size_t added_size) { static int omt_compress_kvspace (OMT omt, struct mempool *memp, size_t added_size) {
u_int32_t total_size_needed = memp->free_offset-memp->frag_size + added_size; u_int32_t total_size_needed = memp->free_offset-memp->frag_size + added_size;
last_total_size_needed = total_size_needed;
if (total_size_needed+total_size_needed/4 >= memp->size) { if (total_size_needed+total_size_needed/4 >= memp->size) {
memp->size = total_size_needed+total_size_needed/4; memp->size = total_size_needed+total_size_needed/4;
} }
...@@ -3356,6 +3360,7 @@ static int omt_compress_kvspace (OMT omt, struct mempool *memp, size_t added_siz ...@@ -3356,6 +3360,7 @@ static int omt_compress_kvspace (OMT omt, struct mempool *memp, size_t added_siz
void *mempool_malloc_from_omt(OMT omt, struct mempool *mp, size_t size) { void *mempool_malloc_from_omt(OMT omt, struct mempool *mp, size_t size) {
void *v = toku_mempool_malloc(mp, size, 1); void *v = toku_mempool_malloc(mp, size, 1);
if (v==0) { if (v==0) {
original_mp = *mp;
if (0 == omt_compress_kvspace(omt, mp, size)) { if (0 == omt_compress_kvspace(omt, mp, size)) {
v = toku_mempool_malloc(mp, size, 1); v = toku_mempool_malloc(mp, size, 1);
assert(v); assert(v);
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment