[SERVER-7460] Issue with threads re-using previously released memory containing a Shard version Created: 24/Oct/12  Updated: 11/Jul/16  Resolved: 09/Nov/12

Status: Closed
Project: Core Server
Component/s: Sharding
Affects Version/s: 2.0.6
Fix Version/s: 2.2.2, 2.3.1

Type: Bug Priority: Critical - P2
Reporter: David Hows Assignee: Spencer Brody (Inactive)
Resolution: Done Votes: 0
Labels: None
Remaining Estimate: Not Specified
Time Spent: Not Specified
Original Estimate: Not Specified

Issue Links:
Depends
Duplicate
is duplicated by SERVER-7461 Possible for simultaneous aggressive ... Closed
Related
is related to SERVER-7606 Refactor how shard version informatio... Closed
Operating System: ALL
Participants:

 Description   

Diff with a simple fix built in version 2.0.6

diff --git a/client/dbclient.h b/client/dbclient.h
index ea55bb4..c305d4a 100644
--- a/client/dbclient.h
+++ b/client/dbclient.h
@@ -114,7 +114,7 @@ namespace mongo {
     };
 
     class DBClientBase;
-
+extern boost::function1<void, DBClientBase*> resetShardVersionCB;
     /**
      * ConnectionString handles parsing different ways to connect to mongo and determining method
      * samples:
@@ -747,7 +747,9 @@ namespace mongo {
         DBClientBase() {
             _writeConcern = W_NORMAL;
         }
-
+        ~DBClientBase() {
+           resetShardVersionCB( this );  
+        }
         WriteConcern getWriteConcern() const { return _writeConcern; }
         void setWriteConcern( WriteConcern w ) { _writeConcern = w; }



 Comments   
Comment by auto [ 09/Nov/12 ]

Author:

{u'date': u'2012-11-08T17:47:28Z', u'email': u'spencer@10gen.com', u'name': u'Spencer T Brody'}

Message: SERVER-7460 Make sure connections never get version information associated with them from an old connection
Branch: v2.2
https://github.com/mongodb/mongo/commit/3cc3b033b4b8f9e969655128da3c5951a4e9fa33

Comment by Spencer Brody (Inactive) [ 08/Nov/12 ]

https://github.com/mongodb/mongo/commit/299e1d26b612fe05b4a78abc439af37d4194b2f5

Comment by auto [ 08/Nov/12 ]

Author:

{u'date': u'2012-11-08T17:47:28Z', u'email': u'spencer@10gen.com', u'name': u'Spencer T Brody'}

Message: SERVER-7460 Make sure connections never get version information associated with them from an old connection
Branch: master
https://github.com/mongodb/mongo/commit/784d65ee8f7b6bf58a1aad4690a9b82524ab1e84

Generated at Thu Feb 08 03:14:36 UTC 2024 using Jira 9.7.1#970001-sha1:2222b88b221c4928ef0de3161136cc90c8356a66.