diff options
author | Kaloian Manassiev <kaloian.manassiev@mongodb.com> | 2015-03-20 15:48:49 -0400 |
---|---|---|
committer | Kaloian Manassiev <kaloian.manassiev@mongodb.com> | 2015-03-24 15:04:58 -0400 |
commit | e23b1c0eba1aa58e22af068e8499c3b018693749 (patch) | |
tree | 8ffb36ee95083da4bd420d6579eaf12ef53422b6 /src/mongo/s/d_migrate.cpp | |
parent | 6d33c3637e073c83138919a5472b181c65a48d08 (diff) | |
download | mongo-e23b1c0eba1aa58e22af068e8499c3b018693749.tar.gz |
SERVER-17690 Move sharding change logging operations to catalog manager
So they can be abstracted behind the interface and not go through a config
server connection directly.
Diffstat (limited to 'src/mongo/s/d_migrate.cpp')
-rw-r--r-- | src/mongo/s/d_migrate.cpp | 19 |
1 files changed, 14 insertions, 5 deletions
diff --git a/src/mongo/s/d_migrate.cpp b/src/mongo/s/d_migrate.cpp index 72f1740ca8c..46967e8bed5 100644 --- a/src/mongo/s/d_migrate.cpp +++ b/src/mongo/s/d_migrate.cpp @@ -73,11 +73,13 @@ #include "mongo/db/operation_context_impl.h" #include "mongo/db/write_concern.h" #include "mongo/logger/ramlog.h" +#include "mongo/s/catalog/catalog_manager.h" #include "mongo/s/chunk.h" #include "mongo/s/chunk_version.h" #include "mongo/s/config.h" #include "mongo/s/d_state.h" #include "mongo/s/distlock.h" +#include "mongo/s/grid.h" #include "mongo/s/shard.h" #include "mongo/s/type_chunk.h" #include "mongo/util/assert_util.h" @@ -175,7 +177,11 @@ namespace mongo { if ( !_cmdErrmsg->empty() ) { _b.append( "errmsg" , *_cmdErrmsg ); } - configServer.logChange( (string)"moveChunk." + _where , _ns, _b.obj() ); + + grid.catalogManager()->logChange(_txn, + (string)"moveChunk." + _where, + _ns, + _b.obj()); } catch ( const std::exception& e ) { warning() << "couldn't record timing for moveChunk '" << _where << "': " << e.what() << migrateLog; @@ -1183,7 +1189,8 @@ namespace mongo { BSONObj chunkInfo = BSON("min" << min << "max" << max << "from" << fromShard.getName() << "to" << toShard.getName()); - configServer.logChange("moveChunk.start", ns, chunkInfo); + + grid.catalogManager()->logChange(txn, "moveChunk.start", ns, chunkInfo); // Always refresh our metadata remotely ChunkVersion origShardVersion; @@ -1719,9 +1726,11 @@ namespace mongo { // 5.d BSONObjBuilder commitInfo; commitInfo.appendElements( chunkInfo ); - if ( res["counts"].type() == Object ) - commitInfo.appendElements( res["counts"].Obj() ); - configServer.logChange( "moveChunk.commit" , ns , commitInfo.obj() ); + if (res["counts"].type() == Object) { + commitInfo.appendElements(res["counts"].Obj()); + } + + grid.catalogManager()->logChange(txn, "moveChunk.commit", ns, commitInfo.obj()); } migrateFromStatus.done(txn); |