Uploaded image for project: 'Core Server'
  1. Core Server
  2. SERVER-7460

Issue with threads re-using previously released memory containing a Shard version

    • Type: Icon: Bug Bug
    • Resolution: Done
    • Priority: Icon: Critical - P2 Critical - P2
    • 2.2.2, 2.3.1
    • Affects Version/s: 2.0.6
    • Component/s: Sharding
    • None
    • ALL

      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; }
      

            Assignee:
            spencer@mongodb.com Spencer Brody (Inactive)
            Reporter:
            david.hows David Hows
            Votes:
            0 Vote for this issue
            Watchers:
            7 Start watching this issue

              Created:
              Updated:
              Resolved: