diff options
author | gregs <greg@10gen.com> | 2011-05-31 15:31:41 -0400 |
---|---|---|
committer | Eliot Horowitz <eliot@10gen.com> | 2011-05-31 17:28:12 -0400 |
commit | c7aed2d982a7769f577d2f727d4ec188637e9183 (patch) | |
tree | 7d6c712e11e55f809497d54d8f969931499617be | |
parent | 06882f6151e281aa314ce8659099ed21817da970 (diff) | |
download | mongo-c7aed2d982a7769f577d2f727d4ec188637e9183.tar.gz |
check for manager before using CS-666
-rw-r--r-- | s/shard_version.cpp | 6 |
1 files changed, 4 insertions, 2 deletions
diff --git a/s/shard_version.cpp b/s/shard_version.cpp index 043b9bd9bce..a189a088c15 100644 --- a/s/shard_version.cpp +++ b/s/shard_version.cpp @@ -97,7 +97,9 @@ namespace mongo { const bool isSharded = conf->isSharded( ns ); if ( isSharded ) { manager = conf->getChunkManager( ns , authoritative ); - officialSequenceNumber = manager->getSequenceNumber(); + // It's possible the chunk manager was reset since we checked whether sharded was true, + // so must check this here. + if( manager ) officialSequenceNumber = manager->getSequenceNumber(); } // has the ChunkManager been reloaded since the last time we updated the connection-level version? @@ -109,7 +111,7 @@ namespace mongo { ShardChunkVersion version = 0; - if ( isSharded ) { + if ( isSharded && manager ) { version = manager->getVersion( Shard::make( conn.getServerAddress() ) ); } |