diff options
author | Eliot Horowitz <eliot@10gen.com> | 2012-06-26 08:34:39 -0400 |
---|---|---|
committer | Eliot Horowitz <eliot@10gen.com> | 2012-06-26 08:34:39 -0400 |
commit | 0d1fd31650d38a64969879bd3875e38946119297 (patch) | |
tree | 92af6184b97338479562e46c6e58203873b418fb /src/mongo | |
parent | 63a957eca0eae9fc3e68bf3305bea7cf65b16985 (diff) | |
download | mongo-0d1fd31650d38a64969879bd3875e38946119297.tar.gz |
remove broken implementation of killing ops if socket is gone
Diffstat (limited to 'src/mongo')
-rw-r--r-- | src/mongo/db/client.cpp | 3 | ||||
-rw-r--r-- | src/mongo/db/client.h | 8 | ||||
-rw-r--r-- | src/mongo/db/curop.cpp | 16 | ||||
-rw-r--r-- | src/mongo/db/prefetch.cpp | 1 | ||||
-rw-r--r-- | src/mongo/dbtests/jsobjtests.cpp | 29 | ||||
-rw-r--r-- | src/mongo/util/net/message_port.cpp | 4 | ||||
-rw-r--r-- | src/mongo/util/net/message_port.h | 4 | ||||
-rw-r--r-- | src/mongo/util/net/sock.cpp | 21 | ||||
-rw-r--r-- | src/mongo/util/net/sock.h | 2 |
9 files changed, 31 insertions, 57 deletions
diff --git a/src/mongo/db/client.cpp b/src/mongo/db/client.cpp index a012ffb7453..a33198a5cf8 100644 --- a/src/mongo/db/client.cpp +++ b/src/mongo/db/client.cpp @@ -125,8 +125,7 @@ namespace mongo { _desc(desc), _god(0), _lastOp(0), - _mp(p), - _sometimes(0) + _mp(p) { _hasWrittenThisPass = false; _pageFaultRetryableSection = 0; diff --git a/src/mongo/db/client.h b/src/mongo/db/client.h index adbbced026e..8b63ca48cf2 100644 --- a/src/mongo/db/client.h +++ b/src/mongo/db/client.h @@ -143,7 +143,6 @@ namespace mongo { BSONObj _handshake; BSONObj _remoteId; AbstractMessagingPort * const _mp; - unsigned _sometimes; bool _hasWrittenThisPass; PageFaultRetryableSection *_pageFaultRetryableSection; @@ -154,13 +153,6 @@ namespace mongo { friend class NoPageFaultsAllowed; // TEMP public: - /** the concept here is the same as MONGO_SOMETIMES. however that - macro uses a static that will be shared by all threads, and each - time incremented it might eject that line from the other cpu caches (?), - so idea is that this is better. - */ - bool sometimes(unsigned howOften) { return ++_sometimes % howOften == 0; } - /* set _god=true temporarily, safely */ class GodScope { bool _prev; diff --git a/src/mongo/db/curop.cpp b/src/mongo/db/curop.cpp index ad1903d3038..783521e2af4 100644 --- a/src/mongo/db/curop.cpp +++ b/src/mongo/db/curop.cpp @@ -189,11 +189,6 @@ namespace mongo { if( c.curop()->killed() ) { uasserted(11601,"operation was interrupted"); } - if( c.sometimes(1024) ) { - AbstractMessagingPort *p = cc().port(); - if( p ) - p->assertStillConnected(); - } } const char * KillCurrentOp::checkForInterruptNoAssert() { @@ -202,17 +197,6 @@ namespace mongo { return "interrupted at shutdown"; if( c.curop()->killed() ) return "interrupted"; - if( c.sometimes(1024) ) { - try { - AbstractMessagingPort *p = cc().port(); - if( p ) - p->assertStillConnected(); - } - catch(...) { - log() << "no longer connected to client"; - return "no longer connected to client"; - } - } return ""; } diff --git a/src/mongo/db/prefetch.cpp b/src/mongo/db/prefetch.cpp index df22063cc0b..1d953f97879 100644 --- a/src/mongo/db/prefetch.cpp +++ b/src/mongo/db/prefetch.cpp @@ -70,6 +70,7 @@ namespace mongo { int indexCount = nsd->nIndexesBeingBuilt(); BSONObjSet unusedKeys; for ( int indexNo = 0; indexNo < indexCount; indexNo++ ) { + log() << "eliot : " << indexNo << endl; // This will page in all index pages for the given object. try { fetchIndexInserters(/*out*/unusedKeys, inserter, nsd, indexNo, obj, unusedDl); diff --git a/src/mongo/dbtests/jsobjtests.cpp b/src/mongo/dbtests/jsobjtests.cpp index b156f004621..f4a275ec28b 100644 --- a/src/mongo/dbtests/jsobjtests.cpp +++ b/src/mongo/dbtests/jsobjtests.cpp @@ -1726,6 +1726,34 @@ namespace JsobjTests { } }; + + class Big3 { + public: + void run() { + const int total = 1000 * 1000; + BSONObjExternalSorter sorter( indexInterfaceForTheseTests, BSONObj() , total * 2 ); + for ( int i=0; i<total; i++ ) { + sorter.add( BSON( "abcabcabcabd" << "basdasdasdasdasdasdadasdasd" << "x" << i ) , 5 , i ); + } + + sorter.sort(); + + auto_ptr<BSONObjExternalSorter::Iterator> i = sorter.iterator(); + int num=0; + double prev = 0; + while ( i->more() ) { + pair<BSONObj,DiskLoc> p = i->next(); + num++; + double cur = p.first["x"].number(); + verify( cur >= prev ); + prev = cur; + } + verify( num == total ); + ASSERT( sorter.numFiles() > 2 ); + } + }; + + class D1 { public: void run() { @@ -2332,6 +2360,7 @@ namespace JsobjTests { add< external_sort::ByDiskLock >(); add< external_sort::Big1 >(); add< external_sort::Big2 >(); + add< external_sort::Big3 >(); add< external_sort::D1 >(); add< CompatBSON >(); add< CompareDottedFieldNamesTest >(); diff --git a/src/mongo/util/net/message_port.cpp b/src/mongo/util/net/message_port.cpp index 9b63b372d47..bd6d3ee0b71 100644 --- a/src/mongo/util/net/message_port.cpp +++ b/src/mongo/util/net/message_port.cpp @@ -245,10 +245,6 @@ again: return true; } - void MessagingPort::assertStillConnected() { - uassert(15901, "client disconnected during operation", psock->stillConnected()); - } - void MessagingPort::say(Message& toSend, int responseTo) { verify( !toSend.empty() ); mmm( log() << "* say() thr:" << GetCurrentThreadId() << endl; ) diff --git a/src/mongo/util/net/message_port.h b/src/mongo/util/net/message_port.h index ce82e7b2faa..259b270bfa8 100644 --- a/src/mongo/util/net/message_port.h +++ b/src/mongo/util/net/message_port.h @@ -37,8 +37,6 @@ namespace mongo { virtual HostAndPort remote() const = 0; virtual unsigned remotePort() const = 0; - virtual void assertStillConnected() = 0; - long long connectionId() const { return _connectionId; } void setConnectionId( long long connectionId ); @@ -93,8 +91,6 @@ namespace mongo { unsigned remotePort() const { return psock->remotePort(); } virtual HostAndPort remote() const; - void assertStillConnected(); - boost::shared_ptr<Socket> psock; void send( const char * data , int len, const char *context ) { diff --git a/src/mongo/util/net/sock.cpp b/src/mongo/util/net/sock.cpp index 7d4cd43aa67..59fa269c12c 100644 --- a/src/mongo/util/net/sock.cpp +++ b/src/mongo/util/net/sock.cpp @@ -627,27 +627,6 @@ namespace mongo { return ::send( _fd , data , len , portSendFlags ); } - bool Socket::stillConnected() { -#ifdef MONGO_SSL - DEV log() << "TODO stillConnected() w/SSL" << endl; -#else - int r = _send("", 0); - if( r < 0 ) { -#if defined(_WIN32) - if ( WSAGetLastError() == WSAETIMEDOUT ) { -#else - if ( ( errno == EAGAIN || errno == EWOULDBLOCK ) ) { -#endif - ; - } - else { - return false; - } - } -#endif - return true; - } - // sends all data or throws an exception void Socket::send( const char * data , int len, const char *context ) { while( len > 0 ) { diff --git a/src/mongo/util/net/sock.h b/src/mongo/util/net/sock.h index 2596837a3b4..2e2d80f8fd5 100644 --- a/src/mongo/util/net/sock.h +++ b/src/mongo/util/net/sock.h @@ -210,8 +210,6 @@ namespace mongo { void setTimeout( double secs ); - bool stillConnected(); - #ifdef MONGO_SSL /** secures inline */ void secure( SSLManager * ssl ); |