Skip to content

Commit f50196e

Browse files
committed
CXX-197 Backport server r2.6.0..r2.6.1 changes
1 parent 1361abd commit f50196e

File tree

7 files changed

+29
-4
lines changed

7 files changed

+29
-4
lines changed

src/mongo/base/error_codes.err

+6
Original file line numberDiff line numberDiff line change
@@ -83,13 +83,19 @@ error_code("RoleDataInconsistent", 80)
8383
error_code("NoClientContext", 81)
8484
error_code("NoProgressMade", 82)
8585
error_code("RemoteResultsUnavailable", 83)
86+
error_code("IndexOptionsConflict", 85 )
87+
error_code("IndexKeySpecsConflict", 86 )
8688

8789
# Non-sequential error codes (for compatibility only)
8890
error_code("NotMaster", 10107) #this comes from assert_util.h
8991
error_code("DuplicateKey", 11000)
9092
error_code("InterruptedAtShutdown", 11600)
9193
error_code("Interrupted", 11601)
9294
error_code("OutOfDiskSpace", 14031 )
95+
error_code("BackgroundOperationInProgressForDatabase", 12586);
96+
error_code("BackgroundOperationInProgressForNamespace", 12587);
9397

9498
error_class("NetworkError", ["HostUnreachable", "HostNotFound"])
9599
error_class("Interruption", ["Interrupted", "InterruptedAtShutdown", "ExceededTimeLimit"])
100+
error_class("IndexCreationError", ["CannotCreateIndex", "IndexOptionsConflict",
101+
"IndexKeySpecsConflict", "IndexAlreadyExists"])

src/mongo/logger/rotatable_file_writer.cpp

+14
Original file line numberDiff line numberDiff line change
@@ -17,6 +17,7 @@
1717

1818
#include "mongo/logger/rotatable_file_writer.h"
1919

20+
#include <boost/filesystem/operations.hpp>
2021
#include <boost/scoped_array.hpp>
2122
#include <cstdio>
2223
#include <fstream>
@@ -211,6 +212,19 @@ namespace {
211212
Status RotatableFileWriter::Use::rotate(const std::string& renameTarget) {
212213
if (_writer->_stream) {
213214
_writer->_stream->flush();
215+
try {
216+
if (boost::filesystem::exists(renameTarget)) {
217+
return Status(ErrorCodes::FileRenameFailed, mongoutils::str::stream() <<
218+
"Renaming file " << _writer->_fileName << " to " <<
219+
renameTarget << " failed; destination already exists");
220+
}
221+
} catch (const std::exception& e) {
222+
return Status(ErrorCodes::FileRenameFailed, mongoutils::str::stream() <<
223+
"Renaming file " << _writer->_fileName << " to " <<
224+
renameTarget << " failed; Cannot verify whether destination "
225+
"already exists: " << e.what());
226+
}
227+
214228
if (0 != renameFile(_writer->_fileName, renameTarget)) {
215229
return Status(ErrorCodes::FileRenameFailed, mongoutils::str::stream() <<
216230
"Failed to rename \"" << _writer->_fileName << "\" to \"" <<

src/mongo/util/assert_util.h

-1
Original file line numberDiff line numberDiff line change
@@ -37,7 +37,6 @@ namespace mongo {
3737
NotMasterOrSecondaryCode = 13436, // uassert( 13436 )
3838
NotMasterNoSlaveOkCode = 13435, // uassert( 13435 )
3939
NotMaster = 10107, // uassert( 10107 )
40-
IndexOptionsDiffer = 17427 // uassert( 17427 )
4140
};
4241

4342
class MONGO_CLIENT_API AssertionCount {

src/mongo/util/log.cpp

+5
Original file line numberDiff line numberDiff line change
@@ -64,6 +64,11 @@ namespace mongo {
6464
RotatableFileManager* manager = logger::globalRotatableFileManager();
6565
RotatableFileManager::FileNameStatusPairVector result(
6666
manager->rotateAll("." + terseCurrentTime(false)));
67+
for (RotatableFileManager::FileNameStatusPairVector::iterator it = result.begin();
68+
it != result.end(); it++) {
69+
warning() << "Rotating log file " << it->first << " failed: " << it->second.toString()
70+
<< endl;
71+
}
6772
return result.empty();
6873
}
6974

src/mongo/util/net/message.h

+1-1
Original file line numberDiff line numberDiff line change
@@ -29,7 +29,7 @@ namespace mongo {
2929
/**
3030
* Maximum accepted message size on the wire protocol.
3131
*/
32-
const int MaxMessageSizeBytes = 48 * 1000 * 1000;
32+
const size_t MaxMessageSizeBytes = 48 * 1000 * 1000;
3333

3434
class Message;
3535
class MessagingPort;

src/mongo/util/net/message_port.cpp

+2-1
Original file line numberDiff line numberDiff line change
@@ -202,7 +202,8 @@ namespace mongo {
202202
sslGlobalParams.sslMode.load() != SSLGlobalParams::SSLMode_requireSSL);
203203
#endif // MONGO_SSL
204204
}
205-
else if ( len < static_cast<int>(sizeof(MSGHEADER)) || len > MaxMessageSizeBytes ) {
205+
if ( static_cast<size_t>(len) < sizeof(MSGHEADER) ||
206+
static_cast<size_t>(len) > MaxMessageSizeBytes ) {
206207
LOG(0) << "recv(): message len " << len << " is invalid. "
207208
<< "Min " << sizeof(MSGHEADER) << " Max: " << MaxMessageSizeBytes << endl;
208209
return false;

src/mongo/util/version.cpp

+1-1
Original file line numberDiff line numberDiff line change
@@ -31,7 +31,7 @@ namespace mongo {
3131
* 1.2.3-rc4-pre-
3232
* If you really need to do something else you'll need to fix _versionArray()
3333
*/
34-
const char versionString[] = "2.6.0";
34+
const char versionString[] = "2.6.1";
3535

3636
// See unit test for example outputs
3737
BSONArray toVersionArray(const char* version){

0 commit comments

Comments
 (0)