diff options
author | Greg Studer <greg@10gen.com> | 2013-02-11 17:27:33 -0500 |
---|---|---|
committer | Dan Pasette <dan@10gen.com> | 2013-03-20 20:32:31 -0400 |
commit | aa3eab2d92a96d13890fa84b524cd48990ce24c0 (patch) | |
tree | fa7316c6f482cd8395a545a9cc5dc6795ad609c3 | |
parent | 679219a64948a9702c639d2a3bdbd20b6be68723 (diff) | |
download | mongo-aa3eab2d92a96d13890fa84b524cd48990ce24c0.tar.gz |
SERVER-8335 remember _dataWritten for unaffected chunks after partial chunk manager reload
-rw-r--r-- | src/mongo/s/chunk.cpp | 2 | ||||
-rw-r--r-- | src/mongo/s/chunk.h | 5 |
2 files changed, 7 insertions, 0 deletions
diff --git a/src/mongo/s/chunk.cpp b/src/mongo/s/chunk.cpp index 2a20b40940e..9a7f774da87 100644 --- a/src/mongo/s/chunk.cpp +++ b/src/mongo/s/chunk.cpp @@ -750,6 +750,8 @@ namespace mongo { oldC->getShard(), oldC->getLastmod() ) ); + c->setBytesWritten( oldC->getBytesWritten() ); + chunkMap.insert( make_pair( oldC->getMax(), c ) ); } diff --git a/src/mongo/s/chunk.h b/src/mongo/s/chunk.h index 5fd01c5abe4..84753aa32dc 100644 --- a/src/mongo/s/chunk.h +++ b/src/mongo/s/chunk.h @@ -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 |