Project

Profile

Help

Issue #1012

Updated by bmbouter over 8 years ago

Pulp configures our MongoDB connection without read_preferences, but also only tells pymongo about the first of the database seeds, even if there are multiple of the specified in the seeds field of the [database] section in server.conf. seeds. This means that if the first seed listed is not the current primary, that Pulp will not be able connect to issue any writes. 

 The fix for this is to try the first seed, other nodes and if it is not will raise an Exception about the primary or cannot connect for some network reason to iterate through the remaining seeds until a valid connection is formed. It should log at info level for each of these connections so Pulp reports as it progresses. If being against a valid connection cannot be formed it should log at error level as it does today. secondary. 

 h2. QE instructions 

 1. create We can fix this by either configuring a 3 node mongoDB setup that uses a basic replica_set configuration 
 2. determine which mongoDB hostname is read_preference[citation-needed, will fill out later], or by giving pymongo the secondary 
 3. configure server.conf [database] section with seeds="" to the comma separated full list of these 3 mongoDB hosts. It's very important that replicas. I can't remember if we also tell mongo the "primary" mongoDB server be the last one in the seeds list 
 4. start Pulp and verify replica set name, but if we do not, we should do that it logs that a connection is created to the first seed, the second seed, and finally the primary. 
 5. ensure pulp can be fully used while connected to the third seed (the primary) 
 6. stop all pulp services. 
 7. edit server.conf and remove the primary from the seeds list so that only the two secondary servers are present 
 8) start Pulp and verify that it cannot form a valid connection to a mongoDB server too[will fill out later as well].

Back