summaryrefslogtreecommitdiff
path: root/s/request.cpp
diff options
context:
space:
mode:
authorEliot Horowitz <eliot@10gen.com>2010-05-28 14:23:37 -0400
committerEliot Horowitz <eliot@10gen.com>2010-05-28 14:23:37 -0400
commite365deea86c16237daf71decaa3600d82bd59594 (patch)
tree53f01f8675f8fe685af04654b8ff2e609c145a48 /s/request.cpp
parent1798ea2d855505d2a02cf8a9b1936487caa1b568 (diff)
downloadmongo-e365deea86c16237daf71decaa3600d82bd59594.tar.gz
clean up cursors SERVER-1167
Diffstat (limited to 's/request.cpp')
-rw-r--r--s/request.cpp22
1 files changed, 21 insertions, 1 deletions
diff --git a/s/request.cpp b/s/request.cpp
index f2d0d490900..9fbfb38772c 100644
--- a/s/request.cpp
+++ b/s/request.cpp
@@ -32,6 +32,7 @@
#include "config.h"
#include "chunk.h"
#include "stats.h"
+#include "cursors.h"
namespace mongo {
@@ -49,6 +50,10 @@ namespace mongo {
}
void Request::reset( bool reload ){
+ if ( _m.operation() == dbKillCursors ){
+ return;
+ }
+
_config = grid.getDBConfig( getns() );
if ( reload )
uassert( 10192 , "db config reload failed!" , _config->reload() );
@@ -77,11 +82,18 @@ namespace mongo {
}
void Request::process( int attempt ){
- log(3) << "Request::process ns: " << getns() << " msg id:" << (int)(_m.header()->id) << " attempt: " << attempt << endl;
int op = _m.operation();
assert( op > dbMsg );
+ if ( op == dbKillCursors ){
+ cursorCache.gotKillCursors( _m );
+ return;
+ }
+
+
+ log(3) << "Request::process ns: " << getns() << " msg id:" << (int)(_m.header()->id) << " attempt: " << attempt << endl;
+
Strategy * s = SINGLE;
_counter = &opsNonSharded;
@@ -129,6 +141,14 @@ namespace mongo {
globalOpCounters.gotInsert();
_counter->gotInsert();
}
+
+ void Request::reply( Message & response , const string& fromServer ){
+ long long cursor =response.header()->getCursor();
+ if ( cursor ){
+ cursorCache.storeRef( fromServer , cursor );
+ }
+ _p->reply( _m , response , _id );
+ }
ClientInfo::ClientInfo( int clientId ) : _id( clientId ){
_cur = &_a;