summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorMathias Stearn <mathias@10gen.com>2016-04-07 18:24:19 -0400
committerMathias Stearn <mathias@10gen.com>2016-04-21 18:38:56 -0400
commit98ba7f26e13edbd221afca2d119e844896397752 (patch)
tree40e36ea7e2c78a10afb038c8629b5c1c29c28fe5
parentb95db102cadf57661e53ae6aa81c4ab9a1254a16 (diff)
downloadmongo-98ba7f26e13edbd221afca2d119e844896397752.tar.gz
SERVER-23128 Remove sharding logic from UpdateLifecycleImpl
It didn't actually do anything
-rw-r--r--src/mongo/db/commands/find_and_modify.cpp6
-rw-r--r--src/mongo/db/commands/write_commands/batch_executor.cpp2
-rw-r--r--src/mongo/db/commands/write_commands/write_commands.cpp2
-rw-r--r--src/mongo/db/dbhelpers.cpp4
-rw-r--r--src/mongo/db/instance.cpp3
-rw-r--r--src/mongo/db/ops/update_lifecycle_impl.cpp6
-rw-r--r--src/mongo/db/ops/update_lifecycle_impl.h3
-rw-r--r--src/mongo/db/repl/oplog.cpp4
-rw-r--r--src/mongo/db/repl/rs_rollback.cpp2
-rw-r--r--src/mongo/db/s/sharding_state_recovery.cpp2
-rw-r--r--src/mongo/dbtests/query_stage_update.cpp10
11 files changed, 18 insertions, 26 deletions
diff --git a/src/mongo/db/commands/find_and_modify.cpp b/src/mongo/db/commands/find_and_modify.cpp
index 7d89e39e548..e13644762b4 100644
--- a/src/mongo/db/commands/find_and_modify.cpp
+++ b/src/mongo/db/commands/find_and_modify.cpp
@@ -279,8 +279,7 @@ public:
Explain::explainStages(exec.get(), verbosity, out);
} else {
UpdateRequest request(nsString);
- const bool ignoreVersion = false;
- UpdateLifecycleImpl updateLifecycle(ignoreVersion, nsString);
+ UpdateLifecycleImpl updateLifecycle(nsString);
const bool isExplain = true;
makeUpdateRequest(args, isExplain, &updateLifecycle, &request);
@@ -417,8 +416,7 @@ public:
appendCommandResponse(exec.get(), args.isRemove(), value, result);
} else {
UpdateRequest request(nsString);
- const bool ignoreVersion = false;
- UpdateLifecycleImpl updateLifecycle(ignoreVersion, nsString);
+ UpdateLifecycleImpl updateLifecycle(nsString);
const bool isExplain = false;
makeUpdateRequest(args, isExplain, &updateLifecycle, &request);
diff --git a/src/mongo/db/commands/write_commands/batch_executor.cpp b/src/mongo/db/commands/write_commands/batch_executor.cpp
index 7886c225b2a..69bd166f4e5 100644
--- a/src/mongo/db/commands/write_commands/batch_executor.cpp
+++ b/src/mongo/db/commands/write_commands/batch_executor.cpp
@@ -1004,7 +1004,7 @@ static void multiUpdate(OperationContext* txn,
request.setUpdates(updateItem.getUpdate()->getUpdateExpr());
request.setMulti(isMulti);
request.setUpsert(updateItem.getUpdate()->getUpsert());
- UpdateLifecycleImpl updateLifecycle(true, request.getNamespaceString());
+ UpdateLifecycleImpl updateLifecycle(request.getNamespaceString());
request.setLifecycle(&updateLifecycle);
// Updates from the write commands path can yield.
diff --git a/src/mongo/db/commands/write_commands/write_commands.cpp b/src/mongo/db/commands/write_commands/write_commands.cpp
index ee86ad4be96..78f5cde997c 100644
--- a/src/mongo/db/commands/write_commands/write_commands.cpp
+++ b/src/mongo/db/commands/write_commands/write_commands.cpp
@@ -187,7 +187,7 @@ Status WriteCmd::explain(OperationContext* txn,
updateRequest.setUpdates(batchItem.getUpdate()->getUpdateExpr());
updateRequest.setMulti(batchItem.getUpdate()->getMulti());
updateRequest.setUpsert(batchItem.getUpdate()->getUpsert());
- UpdateLifecycleImpl updateLifecycle(true, updateRequest.getNamespaceString());
+ UpdateLifecycleImpl updateLifecycle(updateRequest.getNamespaceString());
updateRequest.setLifecycle(&updateLifecycle);
updateRequest.setExplain();
diff --git a/src/mongo/db/dbhelpers.cpp b/src/mongo/db/dbhelpers.cpp
index b266fa268e9..623a06b9098 100644
--- a/src/mongo/db/dbhelpers.cpp
+++ b/src/mongo/db/dbhelpers.cpp
@@ -250,7 +250,7 @@ void Helpers::upsert(OperationContext* txn, const string& ns, const BSONObj& o,
request.setUpdates(o);
request.setUpsert();
request.setFromMigration(fromMigrate);
- UpdateLifecycleImpl updateLifecycle(true, requestNs);
+ UpdateLifecycleImpl updateLifecycle(requestNs);
request.setLifecycle(&updateLifecycle);
update(txn, context.db(), request, &debug);
@@ -265,7 +265,7 @@ void Helpers::putSingleton(OperationContext* txn, const char* ns, BSONObj obj) {
request.setUpdates(obj);
request.setUpsert();
- UpdateLifecycleImpl updateLifecycle(true, requestNs);
+ UpdateLifecycleImpl updateLifecycle(requestNs);
request.setLifecycle(&updateLifecycle);
update(txn, context.db(), request, &debug);
diff --git a/src/mongo/db/instance.cpp b/src/mongo/db/instance.cpp
index 4ad5616781a..021e2e6e6c2 100644
--- a/src/mongo/db/instance.cpp
+++ b/src/mongo/db/instance.cpp
@@ -673,7 +673,6 @@ void receivedUpdate(OperationContext* txn, const NamespaceString& nsString, Mess
verify(query.objsize() + toupdate.objsize() < m.header().dataLen());
bool upsert = flags & UpdateOption_Upsert;
bool multi = flags & UpdateOption_Multi;
- bool broadcast = flags & UpdateOption_Broadcast;
op.debug().query = query;
{
@@ -692,7 +691,7 @@ void receivedUpdate(OperationContext* txn, const NamespaceString& nsString, Mess
request.setMulti(multi);
request.setQuery(query);
request.setUpdates(toupdate);
- UpdateLifecycleImpl updateLifecycle(broadcast, nsString);
+ UpdateLifecycleImpl updateLifecycle(nsString);
request.setLifecycle(&updateLifecycle);
request.setYieldPolicy(PlanExecutor::YIELD_AUTO);
diff --git a/src/mongo/db/ops/update_lifecycle_impl.cpp b/src/mongo/db/ops/update_lifecycle_impl.cpp
index 40c86f3fd80..a5202948963 100644
--- a/src/mongo/db/ops/update_lifecycle_impl.cpp
+++ b/src/mongo/db/ops/update_lifecycle_impl.cpp
@@ -51,11 +51,7 @@ std::shared_ptr<CollectionMetadata> getMetadata(const NamespaceString& nsString)
} // namespace
-UpdateLifecycleImpl::UpdateLifecycleImpl(bool ignoreVersion, const NamespaceString& nsStr)
- : _nsString(nsStr),
- _shardVersion((!ignoreVersion && getMetadata(_nsString))
- ? getMetadata(_nsString)->getShardVersion()
- : ChunkVersion::IGNORED()) {}
+UpdateLifecycleImpl::UpdateLifecycleImpl(const NamespaceString& nsStr) : _nsString(nsStr) {}
void UpdateLifecycleImpl::setCollection(Collection* collection) {
_collection = collection;
diff --git a/src/mongo/db/ops/update_lifecycle_impl.h b/src/mongo/db/ops/update_lifecycle_impl.h
index da67a8f2f9d..b9a0f072190 100644
--- a/src/mongo/db/ops/update_lifecycle_impl.h
+++ b/src/mongo/db/ops/update_lifecycle_impl.h
@@ -47,7 +47,7 @@ public:
*
* nsString represents the namespace for the
*/
- UpdateLifecycleImpl(bool ignoreVersion, const NamespaceString& nsString);
+ UpdateLifecycleImpl(const NamespaceString& nsString);
virtual void setCollection(Collection* collection);
@@ -59,7 +59,6 @@ public:
private:
const NamespaceString& _nsString;
- const ChunkVersion _shardVersion;
Collection* _collection;
};
diff --git a/src/mongo/db/repl/oplog.cpp b/src/mongo/db/repl/oplog.cpp
index 50f0dc5f039..ca0620ab203 100644
--- a/src/mongo/db/repl/oplog.cpp
+++ b/src/mongo/db/repl/oplog.cpp
@@ -882,7 +882,7 @@ Status applyOperation_inlock(OperationContext* txn,
request.setQuery(b.done());
request.setUpdates(o);
request.setUpsert();
- UpdateLifecycleImpl updateLifecycle(true, requestNs);
+ UpdateLifecycleImpl updateLifecycle(requestNs);
request.setLifecycle(&updateLifecycle);
UpdateResult res = update(txn, db, request, &debug);
@@ -913,7 +913,7 @@ Status applyOperation_inlock(OperationContext* txn,
request.setQuery(updateCriteria);
request.setUpdates(o);
request.setUpsert(upsert);
- UpdateLifecycleImpl updateLifecycle(true, requestNs);
+ UpdateLifecycleImpl updateLifecycle(requestNs);
request.setLifecycle(&updateLifecycle);
UpdateResult ur = update(txn, db, request, &debug);
diff --git a/src/mongo/db/repl/rs_rollback.cpp b/src/mongo/db/repl/rs_rollback.cpp
index c9a5e93dea1..2bcc0cd34f2 100644
--- a/src/mongo/db/repl/rs_rollback.cpp
+++ b/src/mongo/db/repl/rs_rollback.cpp
@@ -751,7 +751,7 @@ void syncFixUp(OperationContext* txn,
request.setUpdates(idAndDoc.second);
request.setGod();
request.setUpsert();
- UpdateLifecycleImpl updateLifecycle(true, requestNs);
+ UpdateLifecycleImpl updateLifecycle(requestNs);
request.setLifecycle(&updateLifecycle);
update(txn, ctx.db(), request, &debug);
diff --git a/src/mongo/db/s/sharding_state_recovery.cpp b/src/mongo/db/s/sharding_state_recovery.cpp
index 7d229d289d1..85d4fd3698e 100644
--- a/src/mongo/db/s/sharding_state_recovery.cpp
+++ b/src/mongo/db/s/sharding_state_recovery.cpp
@@ -197,7 +197,7 @@ Status modifyRecoveryDocument(OperationContext* txn,
updateReq.setQuery(RecoveryDocument::getQuery());
updateReq.setUpdates(updateObj);
updateReq.setUpsert();
- UpdateLifecycleImpl updateLifecycle(true, NamespaceString::kConfigCollectionNamespace);
+ UpdateLifecycleImpl updateLifecycle(NamespaceString::kConfigCollectionNamespace);
updateReq.setLifecycle(&updateLifecycle);
UpdateResult result = update(txn, autoGetOrCreateDb->getDb(), updateReq, &opDebug);
diff --git a/src/mongo/dbtests/query_stage_update.cpp b/src/mongo/dbtests/query_stage_update.cpp
index 94632afb4a7..a81e6f78e92 100644
--- a/src/mongo/dbtests/query_stage_update.cpp
+++ b/src/mongo/dbtests/query_stage_update.cpp
@@ -195,7 +195,7 @@ public:
ASSERT_EQUALS(0U, count(BSONObj()));
UpdateRequest request(nss);
- UpdateLifecycleImpl updateLifecycle(false, nss);
+ UpdateLifecycleImpl updateLifecycle(nss);
request.setLifecycle(&updateLifecycle);
// Update is the upsert {_id: 0, x: 1}, {$set: {y: 2}}.
@@ -265,7 +265,7 @@ public:
getRecordIds(coll, CollectionScanParams::FORWARD, &recordIds);
UpdateRequest request(nss);
- UpdateLifecycleImpl updateLifecycle(false, nss);
+ UpdateLifecycleImpl updateLifecycle(nss);
request.setLifecycle(&updateLifecycle);
// Update is a multi-update that sets 'bar' to 3 in every document
@@ -370,7 +370,7 @@ public:
OldClientWriteContext ctx(&_txn, nss.ns());
OpDebug* opDebug = &CurOp::get(_txn)->debug();
Collection* coll = ctx.getCollection();
- UpdateLifecycleImpl updateLifecycle(false, nss);
+ UpdateLifecycleImpl updateLifecycle(nss);
UpdateRequest request(nss);
UpdateDriver driver((UpdateDriver::Options()));
const int targetDocIndex = 0; // We'll be working with the first doc in the collection.
@@ -458,7 +458,7 @@ public:
OldClientWriteContext ctx(&_txn, nss.ns());
OpDebug* opDebug = &CurOp::get(_txn)->debug();
Collection* coll = ctx.getCollection();
- UpdateLifecycleImpl updateLifecycle(false, nss);
+ UpdateLifecycleImpl updateLifecycle(nss);
UpdateRequest request(nss);
UpdateDriver driver((UpdateDriver::Options()));
const int targetDocIndex = 10;
@@ -542,7 +542,7 @@ public:
OldClientWriteContext ctx(&_txn, nss.ns());
OpDebug* opDebug = &CurOp::get(_txn)->debug();
Collection* coll = ctx.getCollection();
- UpdateLifecycleImpl updateLifecycle(false, nss);
+ UpdateLifecycleImpl updateLifecycle(nss);
UpdateRequest request(nss);
UpdateDriver driver((UpdateDriver::Options()));
const BSONObj query = BSONObj();