{"action":"created","issue":{"url":"https://api.github.com/repos/Automattic/mongoose/issues/4670","repository_url":"https://api.github.com/repos/Automattic/mongoose","labels_url":"https://api.github.com/repos/Automattic/mongoose/issues/4670/labels{/name}","comments_url":"https://api.github.com/repos/Automattic/mongoose/issues/4670/comments","events_url":"https://api.github.com/repos/Automattic/mongoose/issues/4670/events","html_url":"https://github.com/Automattic/mongoose/issues/4670","id":186723186,"number":4670,"title":"readPreference with secondaryPreferred not working with read command","user":{"login":"conglq","id":14884100,"avatar_url":"https://avatars.githubusercontent.com/u/14884100?v=3","gravatar_id":"","url":"https://api.github.com/users/conglq","html_url":"https://github.com/conglq","followers_url":"https://api.github.com/users/conglq/followers","following_url":"https://api.github.com/users/conglq/following{/other_user}","gists_url":"https://api.github.com/users/conglq/gists{/gist_id}","starred_url":"https://api.github.com/users/conglq/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/conglq/subscriptions","organizations_url":"https://api.github.com/users/conglq/orgs","repos_url":"https://api.github.com/users/conglq/repos","events_url":"https://api.github.com/users/conglq/events{/privacy}","received_events_url":"https://api.github.com/users/conglq/received_events","type":"User","site_admin":false},"labels":[{"id":169279105,"url":"https://api.github.com/repos/Automattic/mongoose/labels/can't%20reproduce","name":"can't reproduce","color":"bfdadc","default":false}],"state":"open","locked":false,"assignee":null,"assignees":[],"milestone":null,"comments":11,"created_at":"2016-11-02T06:34:36Z","updated_at":"2016-11-08T19:28:48Z","closed_at":null,"body":"I set readPreference: secondaryPreferred, only write command working and read does not with mongoose@4.6.4.\r\n\r\nI try mongoose 3.8.40 it works well.\r\nPlease help me to fix it. Thanks\r\n\r\nThis is my config\r\nmongoose.connect(\"mongodb://mongodb1.com:27017,mongodb2:27017/db\", options);\r\n\r\noptions config:\r\n\r\n\"db\": {\r\n            \"readPreference\": \"secondaryPreferred\"\r\n        },\r\n\"replset\": {\r\n            \"rs_name\": \"rs_dev\",\r\n            \"socketOptions\": {\r\n                \"keepAlive\": 300000,\r\n                \"connectTimeoutMS\": 30000\r\n            }\r\n        }"},"comment":{"url":"https://api.github.com/repos/Automattic/mongoose/issues/comments/259234625","html_url":"https://github.com/Automattic/mongoose/issues/4670#issuecomment-259234625","issue_url":"https://api.github.com/repos/Automattic/mongoose/issues/4670","id":259234625,"user":{"login":"paton","id":609881,"avatar_url":"https://avatars.githubusercontent.com/u/609881?v=3","gravatar_id":"","url":"https://api.github.com/users/paton","html_url":"https://github.com/paton","followers_url":"https://api.github.com/users/paton/followers","following_url":"https://api.github.com/users/paton/following{/other_user}","gists_url":"https://api.github.com/users/paton/gists{/gist_id}","starred_url":"https://api.github.com/users/paton/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/paton/subscriptions","organizations_url":"https://api.github.com/users/paton/orgs","repos_url":"https://api.github.com/users/paton/repos","events_url":"https://api.github.com/users/paton/events{/privacy}","received_events_url":"https://api.github.com/users/paton/received_events","type":"User","site_admin":false},"created_at":"2016-11-08T19:28:48Z","updated_at":"2016-11-08T19:28:48Z","body":"We changed all of our `read('sp')` commands to `read('s')` and queries are now reading from secondaries. Not sure what was causing `sp` to prefer primary.\r\n\r\nThese are our 3 secondaries (4th primary not showing). The spike in activity is when we deployed the `read('s')` change.\r\n\r\n![image](https://cloud.githubusercontent.com/assets/609881/20113698/56304f00-a5a6-11e6-8162-40eae7ae420a.png)\r\n"}}
{"actor":{"display_login":"paton"}}