summaryrefslogtreecommitdiff
path: root/src/mongo/s
diff options
context:
space:
mode:
Diffstat (limited to 'src/mongo/s')
-rw-r--r--src/mongo/s/catalog/type_chunk.h2
-rw-r--r--src/mongo/s/chunk_version.h2
-rw-r--r--src/mongo/s/client_info.cpp2
-rw-r--r--src/mongo/s/cluster_last_error_info.cpp2
-rw-r--r--src/mongo/s/config.h1
-rw-r--r--src/mongo/s/d_migrate.cpp12
-rw-r--r--src/mongo/s/type_database.h2
-rw-r--r--src/mongo/s/type_shard.h2
-rw-r--r--src/mongo/s/write_ops/batch_downconvert.cpp6
-rw-r--r--src/mongo/s/write_ops/batch_downconvert.h2
-rw-r--r--src/mongo/s/write_ops/batch_write_exec.cpp4
-rw-r--r--src/mongo/s/write_ops/batch_write_exec.h8
-rw-r--r--src/mongo/s/write_ops/batched_command_response.cpp8
-rw-r--r--src/mongo/s/write_ops/batched_command_response.h8
-rw-r--r--src/mongo/s/write_ops/batched_delete_request_test.cpp4
-rw-r--r--src/mongo/s/write_ops/batched_insert_request_test.cpp2
-rw-r--r--src/mongo/s/write_ops/batched_request_metadata.h2
-rw-r--r--src/mongo/s/write_ops/batched_request_metadata_test.cpp4
-rw-r--r--src/mongo/s/write_ops/batched_update_request_test.cpp4
19 files changed, 40 insertions, 37 deletions
diff --git a/src/mongo/s/catalog/type_chunk.h b/src/mongo/s/catalog/type_chunk.h
index 3c03bc959e1..a53c256b6c0 100644
--- a/src/mongo/s/catalog/type_chunk.h
+++ b/src/mongo/s/catalog/type_chunk.h
@@ -31,7 +31,7 @@
#include <boost/optional.hpp>
#include <string>
-#include "mongo/bson/bson_field.h"
+#include "mongo/db/jsobj.h"
#include "mongo/s/chunk_version.h"
namespace mongo {
diff --git a/src/mongo/s/chunk_version.h b/src/mongo/s/chunk_version.h
index 720fd48de53..50f121b97ee 100644
--- a/src/mongo/s/chunk_version.h
+++ b/src/mongo/s/chunk_version.h
@@ -264,7 +264,7 @@ namespace mongo {
return ChunkVersion( 0, 0, el.OID() );
}
- if( type == Timestamp || type == Date ){
+ if( type == bsonTimestamp || type == Date ){
return fromDeprecatedLong( el._numberLong(), OID() );
}
diff --git a/src/mongo/s/client_info.cpp b/src/mongo/s/client_info.cpp
index adfefc5663e..bc7f0a91f15 100644
--- a/src/mongo/s/client_info.cpp
+++ b/src/mongo/s/client_info.cpp
@@ -34,6 +34,8 @@
#include "mongo/s/client_info.h"
+#include <boost/thread.hpp>
+
#include "mongo/db/auth/authorization_manager_global.h"
#include "mongo/db/auth/authorization_session.h"
#include "mongo/db/service_context.h"
diff --git a/src/mongo/s/cluster_last_error_info.cpp b/src/mongo/s/cluster_last_error_info.cpp
index c2a1402c02e..8347bd50ec0 100644
--- a/src/mongo/s/cluster_last_error_info.cpp
+++ b/src/mongo/s/cluster_last_error_info.cpp
@@ -90,7 +90,7 @@ namespace mongo {
ConnectionString shardConn = ConnectionString::parse(hostString, errmsg);
BSONElement subobj = result[kGLEStatsFieldName];
- OpTime lastOpTime = subobj[kGLEStatsLastOpTimeFieldName]._opTime();
+ Timestamp lastOpTime = subobj[kGLEStatsLastOpTimeFieldName].timestamp();
OID electionId = subobj[kGLEStatsElectionIdFieldName].OID();
ClientInfo* clientInfo = ClientInfo::get();
LOG(4) << "saveGLEStats lastOpTime:" << lastOpTime
diff --git a/src/mongo/s/config.h b/src/mongo/s/config.h
index cf9c6d1bf3f..9a3128fc114 100644
--- a/src/mongo/s/config.h
+++ b/src/mongo/s/config.h
@@ -40,6 +40,7 @@
#include "mongo/client/dbclient_rs.h"
#include "mongo/s/shard.h"
#include "mongo/s/shard_key_pattern.h"
+#include "mongo/util/concurrency/mutex.h"
namespace mongo {
diff --git a/src/mongo/s/d_migrate.cpp b/src/mongo/s/d_migrate.cpp
index 4b7114592ae..7cb3e9c9968 100644
--- a/src/mongo/s/d_migrate.cpp
+++ b/src/mongo/s/d_migrate.cpp
@@ -2224,7 +2224,7 @@ namespace mongo {
// if running on a replicated system, we'll need to flush the docs we cloned to the secondaries
- OpTime lastOpApplied = repl::ReplClientInfo::forClient(txn->getClient()).getLastOp();
+ Timestamp lastOpApplied = repl::ReplClientInfo::forClient(txn->getClient()).getLastOp();
{
// 4. do bulk of mods
@@ -2395,8 +2395,8 @@ namespace mongo {
BSONObj max,
BSONObj shardKeyPattern,
const BSONObj& xfer,
- OpTime* lastOpApplied) {
- OpTime dummy;
+ Timestamp* lastOpApplied) {
+ Timestamp dummy;
if ( lastOpApplied == NULL ) {
lastOpApplied = &dummy;
}
@@ -2511,7 +2511,7 @@ namespace mongo {
* writeConcern (if not empty) have applied till the specified lastOp.
*/
bool opReplicatedEnough(const OperationContext* txn,
- const OpTime& lastOpApplied,
+ const Timestamp& lastOpApplied,
const WriteConcernOptions& writeConcern) {
WriteConcernOptions majorityWriteConcern;
majorityWriteConcern.wTimeout = -1;
@@ -2538,10 +2538,10 @@ namespace mongo {
const std::string& ns,
BSONObj min,
BSONObj max,
- const OpTime& lastOpApplied,
+ const Timestamp& lastOpApplied,
const WriteConcernOptions& writeConcern) {
if (!opReplicatedEnough(txn, lastOpApplied, writeConcern)) {
- OpTime op( lastOpApplied );
+ Timestamp op( lastOpApplied );
OCCASIONALLY warning() << "migrate commit waiting for a majority of slaves for '"
<< ns << "' " << min << " -> " << max
<< " waiting for: " << op
diff --git a/src/mongo/s/type_database.h b/src/mongo/s/type_database.h
index 68cfa009ec8..cbecfd490f4 100644
--- a/src/mongo/s/type_database.h
+++ b/src/mongo/s/type_database.h
@@ -31,7 +31,7 @@
#include <boost/optional.hpp>
#include <string>
-#include "mongo/bson/bson_field.h"
+#include "mongo/db/jsobj.h"
namespace mongo {
diff --git a/src/mongo/s/type_shard.h b/src/mongo/s/type_shard.h
index 1b507fb3425..1e6e75da8ad 100644
--- a/src/mongo/s/type_shard.h
+++ b/src/mongo/s/type_shard.h
@@ -32,7 +32,7 @@
#include <string>
#include <vector>
-#include "mongo/bson/bson_field.h"
+#include "mongo/db/jsobj.h"
namespace mongo {
diff --git a/src/mongo/s/write_ops/batch_downconvert.cpp b/src/mongo/s/write_ops/batch_downconvert.cpp
index cc9736c4910..2a402748351 100644
--- a/src/mongo/s/write_ops/batch_downconvert.cpp
+++ b/src/mongo/s/write_ops/batch_downconvert.cpp
@@ -223,7 +223,7 @@ namespace mongo {
// Adds a wOpTime and a wElectionId field to a set of gle options
static BSONObj buildGLECmdWithOpTime( const BSONObj& gleOptions,
- const OpTime& opTime,
+ const Timestamp& opTime,
const OID& electionId ) {
BSONObjBuilder builder;
BSONObjIterator it( gleOptions );
@@ -241,7 +241,7 @@ namespace mongo {
builder.append( el );
}
- builder.appendTimestamp( "wOpTime", opTime.asDate() );
+ builder.append( "wOpTime", opTime );
builder.appendOID( "wElectionId", const_cast<OID*>(&electionId) );
return builder.obj();
}
@@ -261,7 +261,7 @@ namespace mongo {
const ConnectionString& shardEndpoint = it->first;
const HostOpTime hot = it->second;
- const OpTime& opTime = hot.opTime;
+ const Timestamp& opTime = hot.opTime;
const OID& electionId = hot.electionId;
LOG( 3 ) << "enforcing write concern " << options << " on " << shardEndpoint.toString()
diff --git a/src/mongo/s/write_ops/batch_downconvert.h b/src/mongo/s/write_ops/batch_downconvert.h
index b9ba45682ea..7cd8e95169d 100644
--- a/src/mongo/s/write_ops/batch_downconvert.h
+++ b/src/mongo/s/write_ops/batch_downconvert.h
@@ -33,7 +33,7 @@
#include "mongo/base/string_data.h"
#include "mongo/bson/bsonobj.h"
-#include "mongo/bson/optime.h"
+#include "mongo/bson/timestamp.h"
#include "mongo/s/write_ops/batch_write_exec.h"
#include "mongo/s/write_ops/batch_write_op.h"
#include "mongo/s/write_ops/batched_command_request.h"
diff --git a/src/mongo/s/write_ops/batch_write_exec.cpp b/src/mongo/s/write_ops/batch_write_exec.cpp
index 25ca80b7d4b..307c39321ee 100644
--- a/src/mongo/s/write_ops/batch_write_exec.cpp
+++ b/src/mongo/s/write_ops/batch_write_exec.cpp
@@ -291,7 +291,7 @@ namespace mongo {
// or delete any documents, which preserves old behavior but is conservative
_stats->noteWriteAt( shardHost,
response.isLastOpSet() ?
- response.getLastOp() : OpTime(),
+ response.getLastOp() : Timestamp(),
response.isElectionIdSet() ?
response.getElectionId() : OID());
}
@@ -386,7 +386,7 @@ namespace mongo {
}
void BatchWriteExecStats::noteWriteAt(const ConnectionString& host,
- OpTime opTime,
+ Timestamp opTime,
const OID& electionId) {
_writeOpTimes[host] = HostOpTime(opTime, electionId);
}
diff --git a/src/mongo/s/write_ops/batch_write_exec.h b/src/mongo/s/write_ops/batch_write_exec.h
index 195dbc374a2..90907a47443 100644
--- a/src/mongo/s/write_ops/batch_write_exec.h
+++ b/src/mongo/s/write_ops/batch_write_exec.h
@@ -34,7 +34,7 @@
#include <string>
#include "mongo/base/disallow_copying.h"
-#include "mongo/bson/optime.h"
+#include "mongo/bson/timestamp.h"
#include "mongo/s/ns_targeter.h"
#include "mongo/s/shard_resolver.h"
#include "mongo/s/write_ops/batched_command_request.h"
@@ -97,9 +97,9 @@ namespace mongo {
};
struct HostOpTime {
- HostOpTime(OpTime ot, OID e) : opTime(ot), electionId(e) {};
+ HostOpTime(Timestamp ot, OID e) : opTime(ot), electionId(e) {};
HostOpTime() {};
- OpTime opTime;
+ Timestamp opTime;
OID electionId;
};
@@ -112,7 +112,7 @@ namespace mongo {
numRounds( 0 ), numTargetErrors( 0 ), numResolveErrors( 0 ), numStaleBatches( 0 ) {
}
- void noteWriteAt(const ConnectionString& host, OpTime opTime, const OID& electionId);
+ void noteWriteAt(const ConnectionString& host, Timestamp opTime, const OID& electionId);
const HostOpTimeMap& getWriteOpTimes() const;
diff --git a/src/mongo/s/write_ops/batched_command_response.cpp b/src/mongo/s/write_ops/batched_command_response.cpp
index a01dd16a77d..2af007c4602 100644
--- a/src/mongo/s/write_ops/batched_command_response.cpp
+++ b/src/mongo/s/write_ops/batched_command_response.cpp
@@ -45,7 +45,7 @@ namespace mongo {
const BSONField<long long> BatchedCommandResponse::nModified("nModified", 0);
const BSONField<std::vector<BatchedUpsertDetail*> >
BatchedCommandResponse::upsertDetails("upserted");
- const BSONField<OpTime> BatchedCommandResponse::lastOp("lastOp");
+ const BSONField<Timestamp> BatchedCommandResponse::lastOp("lastOp");
const BSONField<OID> BatchedCommandResponse::electionId("electionId");
const BSONField<std::vector<WriteErrorDetail*> >
BatchedCommandResponse::writeErrors("writeErrors");
@@ -223,7 +223,7 @@ namespace mongo {
_upsertDetails.reset();
}
- _lastOp = OpTime();
+ _lastOp = Timestamp();
_isLastOpSet = false;
_electionId = OID();
@@ -452,7 +452,7 @@ namespace mongo {
return _upsertDetails->at(pos);
}
- void BatchedCommandResponse::setLastOp(OpTime lastOp) {
+ void BatchedCommandResponse::setLastOp(Timestamp lastOp) {
_lastOp = lastOp;
_isLastOpSet = true;
}
@@ -465,7 +465,7 @@ namespace mongo {
return _isLastOpSet;
}
- OpTime BatchedCommandResponse::getLastOp() const {
+ Timestamp BatchedCommandResponse::getLastOp() const {
dassert(_isLastOpSet);
return _lastOp;
}
diff --git a/src/mongo/s/write_ops/batched_command_response.h b/src/mongo/s/write_ops/batched_command_response.h
index c7938b5954e..57fc0549330 100644
--- a/src/mongo/s/write_ops/batched_command_response.h
+++ b/src/mongo/s/write_ops/batched_command_response.h
@@ -59,7 +59,7 @@ namespace mongo {
static const BSONField<long long> n;
static const BSONField<long long> nModified;
static const BSONField<std::vector<BatchedUpsertDetail*> > upsertDetails;
- static const BSONField<OpTime> lastOp;
+ static const BSONField<Timestamp> lastOp;
static const BSONField<OID> electionId;
static const BSONField<std::vector<WriteErrorDetail*> > writeErrors;
static const BSONField<WCErrorDetail*> writeConcernError;
@@ -121,10 +121,10 @@ namespace mongo {
const std::vector<BatchedUpsertDetail*>& getUpsertDetails() const;
const BatchedUpsertDetail* getUpsertDetailsAt(std::size_t pos) const;
- void setLastOp(OpTime lastOp);
+ void setLastOp(Timestamp lastOp);
void unsetLastOp();
bool isLastOpSet() const;
- OpTime getLastOp() const;
+ Timestamp getLastOp() const;
void setElectionId(const OID& electionId);
void unsetElectionId();
@@ -181,7 +181,7 @@ namespace mongo {
// Normally, getLastError can use Client::_lastOp, but this is not valid for
// mongos which loses track of the session due to RCAR. Therefore, we must
// keep track of the lastOp manually ourselves.
- OpTime _lastOp;
+ Timestamp _lastOp;
bool _isLastOpSet;
// (O) In addition to keeping track of the above lastOp timestamp, we must also keep
diff --git a/src/mongo/s/write_ops/batched_delete_request_test.cpp b/src/mongo/s/write_ops/batched_delete_request_test.cpp
index 49eba66b61b..33aa331259a 100644
--- a/src/mongo/s/write_ops/batched_delete_request_test.cpp
+++ b/src/mongo/s/write_ops/batched_delete_request_test.cpp
@@ -43,7 +43,7 @@ namespace {
using mongo::BatchedRequestMetadata;
using mongo::BSONArrayBuilder;
using mongo::OID;
- using mongo::OpTime;
+ using mongo::Timestamp;
using std::string;
@@ -62,7 +62,7 @@ namespace {
// The BSON_ARRAY macro doesn't support Timestamps.
BSONArrayBuilder arrBuilder;
- arrBuilder.appendTimestamp(OpTime(1,1).asDate());
+ arrBuilder.append(Timestamp(1,1));
arrBuilder.append(OID::gen());
BSONArray shardVersionArray = arrBuilder.arr();
diff --git a/src/mongo/s/write_ops/batched_insert_request_test.cpp b/src/mongo/s/write_ops/batched_insert_request_test.cpp
index b326cfcfed9..ba553e254b4 100644
--- a/src/mongo/s/write_ops/batched_insert_request_test.cpp
+++ b/src/mongo/s/write_ops/batched_insert_request_test.cpp
@@ -47,7 +47,7 @@ namespace {
// The BSON_ARRAY macro doesn't support Timestamps.
BSONArrayBuilder arrBuilder;
- arrBuilder.appendTimestamp(OpTime(1,1).asDate());
+ arrBuilder.append(Timestamp(1,1));
arrBuilder.append(OID::gen());
BSONArray shardVersionArray = arrBuilder.arr();
diff --git a/src/mongo/s/write_ops/batched_request_metadata.h b/src/mongo/s/write_ops/batched_request_metadata.h
index e2dd99df0c1..029e915757e 100644
--- a/src/mongo/s/write_ops/batched_request_metadata.h
+++ b/src/mongo/s/write_ops/batched_request_metadata.h
@@ -31,8 +31,8 @@
#include <boost/scoped_ptr.hpp>
#include <string>
-#include "mongo/bson/bson_field.h"
#include "mongo/base/disallow_copying.h"
+#include "mongo/db/jsobj.h"
#include "mongo/s/bson_serializable.h"
#include "mongo/s/chunk_version.h"
diff --git a/src/mongo/s/write_ops/batched_request_metadata_test.cpp b/src/mongo/s/write_ops/batched_request_metadata_test.cpp
index 866e6a01d05..562497b5d27 100644
--- a/src/mongo/s/write_ops/batched_request_metadata_test.cpp
+++ b/src/mongo/s/write_ops/batched_request_metadata_test.cpp
@@ -27,13 +27,13 @@ namespace {
using mongo::BSONObj;
using mongo::BatchedRequestMetadata;
using mongo::OID;
- using mongo::OpTime;
+ using mongo::Timestamp;
using std::string;
TEST(RoundTrip, Normal) {
// The BSON_ARRAY macro doesn't support Timestamps.
BSONArrayBuilder arrBuilder;
- arrBuilder.appendTimestamp(OpTime(1,1).asDate());
+ arrBuilder.append(Timestamp(1,1));
arrBuilder.append(OID::gen());
BSONArray shardVersionArray = arrBuilder.arr();
diff --git a/src/mongo/s/write_ops/batched_update_request_test.cpp b/src/mongo/s/write_ops/batched_update_request_test.cpp
index acada54ddd9..c8e69b92b06 100644
--- a/src/mongo/s/write_ops/batched_update_request_test.cpp
+++ b/src/mongo/s/write_ops/batched_update_request_test.cpp
@@ -44,7 +44,7 @@ namespace {
using mongo::BSONArrayBuilder;
using mongo::BSONObj;
using mongo::OID;
- using mongo::OpTime;
+ using mongo::Timestamp;
TEST(RoundTrip, Normal) {
BSONArray updateArray =
@@ -65,7 +65,7 @@ namespace {
// The BSON_ARRAY macro doesn't support Timestamps.
BSONArrayBuilder arrBuilder;
- arrBuilder.appendTimestamp(OpTime(1,1).asDate());
+ arrBuilder.append(Timestamp(1,1));
arrBuilder.append(OID::gen());
BSONArray shardVersionArray = arrBuilder.arr();