diff options
author | Eliot Horowitz <eliot@10gen.com> | 2011-01-03 14:12:32 -0500 |
---|---|---|
committer | Eliot Horowitz <eliot@10gen.com> | 2011-01-03 14:13:07 -0500 |
commit | b99c10320e1fcb28e36167ed0022fcbf55e02cbf (patch) | |
tree | 797a7fbda356fa8994ef2fe1ca28d5a55d9b1cfb /s/client.cpp | |
parent | 17621a52d3cb1bce3042011f538535b34bfde2f5 (diff) | |
download | mongo-b99c10320e1fcb28e36167ed0022fcbf55e02cbf.tar.gz |
new writeback hookup with per connection info SERVER-1467 SERVER-1855
Diffstat (limited to 's/client.cpp')
-rw-r--r-- | s/client.cpp | 24 |
1 files changed, 17 insertions, 7 deletions
diff --git a/s/client.cpp b/s/client.cpp index 0ce5cc8f1ca..2e803afbbe0 100644 --- a/s/client.cpp +++ b/s/client.cpp @@ -123,19 +123,29 @@ namespace mongo { _clients.erase( i ); } - void ClientInfo::_addWriteBack( vector<OID>& all , const BSONObj& o ){ - BSONElement e = o["writeback"]; + void ClientInfo::_addWriteBack( vector<WBInfo>& all , const BSONObj& o ){ + BSONElement w = o["writeback"]; - if ( e.type() == jstOID ) - all.push_back( e.OID() ); + if ( w.type() != jstOID ) + return; + + BSONElement cid = o["connectionId"]; + cout << "ELIOT : " << cid << endl; + + if ( cid.eoo() ){ + error() << "getLastError writeback can't work because of version mis-match" << endl; + return; + } + + all.push_back( WBInfo( cid.numberLong() , w.OID() ) ); } - void ClientInfo::_handleWriteBacks( vector<OID>& all ){ + void ClientInfo::_handleWriteBacks( vector<WBInfo>& all ){ if ( all.size() == 0 ) return; for ( unsigned i=0; i<all.size(); i++ ){ - WriteBackListener::waitFor( all[i] ); + WriteBackListener::waitFor( all[i].connectionId , all[i].id ); } } @@ -149,7 +159,7 @@ namespace mongo { return true; } - vector<OID> writebacks; + vector<WBInfo> writebacks; // handle single server if ( shards->size() == 1 ){ |