Skip to content

Replica Support #7

Open
Open

Description

@msaffitz

Can I use dex to profile against a secondary in a replica set? I'm currently getting errors trying to do that:

Total entries read: 0
Understood entries: 0
Unique recommendations: 0
Entries impacted by recommendations: 0
{
    "linesPassed": 0, 
    "linesRecommended": 0, 
    "results": [], 
    "uniqueRecommendations": 0, 
    "linesProcessed": 0
}
Traceback (most recent call last):
  File "/usr/local/share/python/dex", line 147, in <module>
    main(sys.argv[1:])
  File "/usr/local/share/python/dex", line 129, in main
    return md.watch_profile()
  File "/usr/local/Cellar/python/2.7.3/Frameworks/Python.framework/Versions/2.7/lib/python2.7/site-packages/dex/dex.py", line 194, in watch_profile
    for profile_entry in self._tail_profile(db, WATCH_INTERVAL_SECONDS):
  File "/usr/local/Cellar/python/2.7.3/Frameworks/Python.framework/Versions/2.7/lib/python2.7/site-packages/dex/dex.py", line 279, in _tail_profile
    latest_doc = db['system.profile'].find_one()
  File "/usr/local/Cellar/python/2.7.3/Frameworks/Python.framework/Versions/2.7/lib/python2.7/site-packages/pymongo/collection.py", line 516, in find_one
    for result in self.find(spec_or_id, *args, **kwargs).limit(-1):
  File "/usr/local/Cellar/python/2.7.3/Frameworks/Python.framework/Versions/2.7/lib/python2.7/site-packages/pymongo/cursor.py", line 778, in next
    if len(self.__data) or self._refresh():
  File "/usr/local/Cellar/python/2.7.3/Frameworks/Python.framework/Versions/2.7/lib/python2.7/site-packages/pymongo/cursor.py", line 729, in _refresh
    self.__uuid_subtype))
  File "/usr/local/Cellar/python/2.7.3/Frameworks/Python.framework/Versions/2.7/lib/python2.7/site-packages/pymongo/cursor.py", line 686, in __send_message
    self.__uuid_subtype)
  File "/usr/local/Cellar/python/2.7.3/Frameworks/Python.framework/Versions/2.7/lib/python2.7/site-packages/pymongo/helpers.py", line 102, in _unpack_response
    raise AutoReconnect("master has changed")
AutoReconnect: master has changed

Activity

  1. ghost assigned on Sep 28, 2012
  2. esedor commented on Sep 28, 2012

    @esedor
    Contributor

    An excellent question! No, you currently cannot, but this should be a simple matter of having dex take a flag and pass the appropriate readpreference/slaveok value in the pymongo calls. I will see about tossing that in!

  3. msaffitz commented on Sep 28, 2012

    @msaffitz
    Author

    Cool, thank you!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

Type

No type

Projects

No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions