summaryrefslogtreecommitdiff
path: root/s/config.cpp
diff options
context:
space:
mode:
Diffstat (limited to 's/config.cpp')
-rw-r--r--s/config.cpp7
1 files changed, 5 insertions, 2 deletions
diff --git a/s/config.cpp b/s/config.cpp
index e1016a0..1ad15d5 100644
--- a/s/config.cpp
+++ b/s/config.cpp
@@ -62,6 +62,7 @@ namespace mongo {
void DBConfig::CollectionInfo::shard( DBConfig * db , const string& ns , const ShardKeyPattern& key , bool unique ){
_cm.reset( new ChunkManager( db, ns , key , unique ) );
_dirty = true;
+ _dropped = false;
}
void DBConfig::CollectionInfo::unshard(){
@@ -81,10 +82,12 @@ namespace mongo {
_cm->getInfo( val );
conn->update( ShardNS::collection , key , val.obj() , true );
+ string err = conn->getLastError();
+ uassert( 13473 , (string)"failed to save collection (" + ns + "): " + err , err.size() == 0 );
+
_dirty = false;
}
-
bool DBConfig::isSharded( const string& ns ){
if ( ! _shardingEnabled )
return false;
@@ -124,7 +127,7 @@ namespace mongo {
scoped_lock lk( _lock );
CollectionInfo& ci = _collections[ns];
- uassert( 8043 , "already sharded" , ! ci.isSharded() );
+ uassert( 8043 , "collection already sharded" , ! ci.isSharded() );
log() << "enable sharding on: " << ns << " with shard key: " << fieldsAndOrder << endl;