summaryrefslogtreecommitdiff
path: root/src/mongo/client/syncclusterconnection.cpp
diff options
context:
space:
mode:
Diffstat (limited to 'src/mongo/client/syncclusterconnection.cpp')
-rw-r--r--src/mongo/client/syncclusterconnection.cpp21
1 files changed, 11 insertions, 10 deletions
diff --git a/src/mongo/client/syncclusterconnection.cpp b/src/mongo/client/syncclusterconnection.cpp
index 7bb538079eb..3a927a55777 100644
--- a/src/mongo/client/syncclusterconnection.cpp
+++ b/src/mongo/client/syncclusterconnection.cpp
@@ -82,22 +82,23 @@ namespace mongo {
bool ok = true;
errmsg = "";
for ( size_t i=0; i<_conns.size(); i++ ) {
- BSONObj res;
+ string singleErr;
try {
- if ( _conns[i]->simpleCommand( "admin" , &res , "fsync" ) )
+ // this is fsync=true
+ // which with journalling on is a journal commit
+ // without journalling, is a full fsync
+ _conns[i]->simpleCommand( "admin", NULL, "resetError" );
+ singleErr = _conns[i]->getLastError( true );
+
+ if ( singleErr.size() == 0 )
continue;
+
}
catch ( DBException& e ) {
- errmsg += e.toString();
- }
- catch ( std::exception& e ) {
- errmsg += e.what();
- }
- catch ( ... ) {
- warning() << "unknown exception in SyncClusterConnection::fsync" << endl;
+ singleErr = e.toString();
}
ok = false;
- errmsg += " " + _conns[i]->toString() + ":" + res.toString();
+ errmsg += " " + _conns[i]->toString() + ":" + singleErr;
}
return ok;
}