summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorEliot Horowitz <eliot@10gen.com>2009-12-10 10:46:41 -0500
committerEliot Horowitz <eliot@10gen.com>2009-12-10 10:46:41 -0500
commita74353b6f15331125206c0db17695c66a3c3bcab (patch)
treed78e7e73cf26f2005b7e897d3bc31134a28de6e6
parent32d56f6d81a98b569103149c9ffea9f25a1ece81 (diff)
downloadmongo-a74353b6f15331125206c0db17695c66a3c3bcab.tar.gz
debugging
-rw-r--r--s/commands_admin.cpp8
-rw-r--r--s/config.cpp3
-rw-r--r--s/shardkey.h5
3 files changed, 13 insertions, 3 deletions
diff --git a/s/commands_admin.cpp b/s/commands_admin.cpp
index b913ee1b303..e79b529dc59 100644
--- a/s/commands_admin.cpp
+++ b/s/commands_admin.cpp
@@ -213,6 +213,8 @@ namespace mongo {
errmsg = "already enabled";
return false;
}
+
+ log() << "enabling sharding on: " << dbname << endl;
config->enableSharding();
config->save( true );
@@ -283,6 +285,8 @@ namespace mongo {
conn.done();
}
+
+ log() << "CMD: shardcollection: " << cmdObj << endl;
config->shardCollection( ns , key , cmdObj["unique"].trueValue() );
config->save( true );
@@ -359,7 +363,7 @@ namespace mongo {
return false;
}
}
-
+
ChunkManager * info = config->getChunkManager( ns );
Chunk& old = info->findChunk( find );
@@ -438,6 +442,8 @@ namespace mongo {
errmsg = "you have to specify where you want to move the chunk";
return false;
}
+
+ log() << "CMD: movechunk: " << cmdObj << endl;
ChunkManager * info = config->getChunkManager( ns );
Chunk& c = info->findChunk( find );
diff --git a/s/config.cpp b/s/config.cpp
index 779ab602a25..36461aea34a 100644
--- a/s/config.cpp
+++ b/s/config.cpp
@@ -67,6 +67,7 @@ namespace mongo {
if ( isSharded( ns ) )
throw UserException( "already sharded" );
+ log() << "enable sharding on: " << ns << " with shard key: " << fieldsAndOrder << endl;
_sharded[ns] = CollectionInfo( fieldsAndOrder , unique );
info = new ChunkManager( this , ns , fieldsAndOrder , unique );
@@ -173,7 +174,7 @@ namespace mongo {
* 5) drop everywhere to clean up loose ends
*/
- log(1) << "DBConfig::dropDatabase: " << _name << endl;
+ log() << "DBConfig::dropDatabase: " << _name << endl;
// 1
if ( ! configServer.allUp( errmsg ) ){
diff --git a/s/shardkey.h b/s/shardkey.h
index 2cf65cf4eb0..0c357f612a1 100644
--- a/s/shardkey.h
+++ b/s/shardkey.h
@@ -107,7 +107,10 @@ namespace mongo {
bool partOfShardKey(const string& key ) const {
return patternfields.count( key ) > 0;
}
-
+
+ operator string() const {
+ return pattern.toString();
+ }
private:
BSONObj pattern;
BSONObj gMin;