Permalink
Browse files

SERVER-8335 remember _dataWritten for unaffected chunks after partial…

… chunk manager reload
  • Loading branch information...
1 parent 679219a commit aa3eab2d92a96d13890fa84b524cd48990ce24c0 Greg Studer committed with monkey101 Feb 11, 2013
Showing with 7 additions and 0 deletions.
  1. +2 −0 src/mongo/s/chunk.cpp
  2. +5 −0 src/mongo/s/chunk.h
View
@@ -750,6 +750,8 @@ namespace mongo {
oldC->getShard(),
oldC->getLastmod() ) );
+ c->setBytesWritten( oldC->getBytesWritten() );
+
chunkMap.insert( make_pair( oldC->getMax(), c ) );
}
View
@@ -95,6 +95,11 @@ namespace mongo {
// split support
//
+ long getBytesWritten() const { return _dataWritten; }
+ // Const since _dataWritten is mutable and a heuristic
+ // TODO: Split data tracking and chunk information
+ void setBytesWritten( long bytesWritten ) const { _dataWritten = bytesWritten; }
+
/**
* if the amount of data written nears the max size of a shard
* then we check the real size, and if its too big, we split

0 comments on commit aa3eab2

Please sign in to comment.