Commit e46489bf authored by Zardosht Kasheff's avatar Zardosht Kasheff Committed by Yoni Fogel

[t:3816], merge a fix into main that should unblock performance testing

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