Skip to content

Commit

Permalink
assert for race condition in checkShardVersion
Browse files Browse the repository at this point in the history
  • Loading branch information
erh committed Sep 24, 2010
1 parent 5073890 commit bf11872
Showing 1 changed file with 2 additions and 1 deletion.
3 changes: 2 additions & 1 deletion s/strategy.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -192,7 +192,7 @@ namespace mongo {
static map<string,WriteBackListener*> _cache;
static mongo::mutex _cacheLock;

static set<OID> _seenWritebacks;
static set<OID> _seenWritebacks; // TODO: this can grow unbounded
static mongo::mutex _seenWritebacksLock;

public:
Expand Down Expand Up @@ -293,6 +293,7 @@ namespace mongo {
ShardChunkVersion version = 0;
if ( isSharded ){
version = manager->getVersion( Shard::make( conn.getServerAddress() ) );
assert( officialSequenceNumber == manager->getSequenceNumber() ); // this is to make sure there isn't a race condition
}

log(2) << " have to set shard version for conn: " << &conn << " ns:" << ns
Expand Down

0 comments on commit bf11872

Please sign in to comment.