From 292b938a07d91d0b90676b80408208ee5dcd72c6 Mon Sep 17 00:00:00 2001 From: sears Date: Mon, 27 Feb 2012 01:37:44 +0000 Subject: [PATCH] fix under-counting of tuples inserted into c0, which was causing it to slowly grow over time git-svn-id: svn+ssh://svn.corp.yahoo.com/yahoo/yrl/labs/pnuts/code/logstore@3798 8dad8b1f-cf64-0410-95b6-bcf113ffbcfe --- mergeManager.cpp | 9 ++++++--- 1 file changed, 6 insertions(+), 3 deletions(-) diff --git a/mergeManager.cpp b/mergeManager.cpp index 8855a5a..ac79f10 100644 --- a/mergeManager.cpp +++ b/mergeManager.cpp @@ -428,11 +428,14 @@ void mergeManager::tick(mergeStats * s) { void mergeManager::read_tuple_from_small_component(int merge_level, dataTuple * tup) { if(tup) { mergeStats * s = get_merge_stats(merge_level); - (s->num_tuples_in_small)++; + __sync_fetch_and_add(&s->num_tuples_in_small, 1); + // (s->num_tuples_in_small)++; #if EXTENDED_STATS - (s->stats_bytes_in_small_delta) += tup->byte_length(); + // (s->stats_bytes_in_small_delta) += tup->byte_length(); + __sync_fetch_and_add(&s->stats_bytes_in_small_delta, tup->byte_length()); #endif - (s->bytes_in_small) += tup->byte_length(); + // (s->bytes_in_small) += tup->byte_length(); + __sync_fetch_and_add(&s->bytes_in_small, tup->byte_length()); if(merge_level != 0) { update_progress(s, tup->byte_length()); }