Permalink
Browse files

fix under-counting of tuples inserted into c0, which was causing it t…

…o 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
  • Loading branch information...
1 parent 0d21fcb commit 292b938a07d91d0b90676b80408208ee5dcd72c6 sears committed Feb 27, 2012
Showing with 6 additions and 3 deletions.
  1. +6 −3 mergeManager.cpp
View
@@ -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());
}

0 comments on commit 292b938

Please sign in to comment.