Commit 09ec29dc authored by Zardosht Kasheff's avatar Zardosht Kasheff Committed by Yoni Fogel

[t:3862], back out bad change

git-svn-id: file:///svn/toku/tokudb@34657 c7de825b-a66e-492c-adef-691d508d4ae1
parent 4506633a
......@@ -758,6 +758,7 @@ compress_internal_node_partition(BRTNODE node, int i)
// callback for partially evicting a node
int toku_brtnode_pe_callback (void *brtnode_pv, long UU(bytes_to_free), long* bytes_freed, void* UU(extraargs)) {
BRTNODE node = (BRTNODE)brtnode_pv;
long orig_size = brtnode_memory_size(node);
//
// nothing on internal nodes for now
......@@ -822,7 +823,7 @@ int toku_brtnode_pe_callback (void *brtnode_pv, long UU(bytes_to_free), long* by
}
}
}
*bytes_freed = brtnode_memory_size(node);
*bytes_freed = orig_size - brtnode_memory_size(node);
exit:
if (node->height == 0) {
......
......@@ -1313,16 +1313,16 @@ static void do_partial_eviction(CACHETABLE ct, PAIR p) {
// other than CTPAIR_IDLE so that other threads know to not hold
// ydb lock while waiting on this node
p->state = CTPAIR_WRITING;
long new_size;
long old_size = p->size;
long bytes_freed;
cachetable_unlock(ct);
p->pe_callback(p->value, 0, &new_size, p->write_extraargs);
p->pe_callback(p->value, 0, &bytes_freed, p->write_extraargs);
cachetable_lock(ct);
//assert(bytes_freed <= ct->size_current);
//assert(bytes_freed <= curr_in_clock->size);
ct->size_current += new_size;
ct->size_current -= old_size;
p->size = new_size;
assert(bytes_freed <= ct->size_current);
assert(bytes_freed <= p->size);
ct->size_current -= bytes_freed;
p->size -= bytes_freed;
assert(ct->size_evicting >= p->size_evicting_estimate);
ct->size_evicting -= p->size_evicting_estimate;
......
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