lpreports doesn't get new primary on mongo replicaset rebuild

Bug #1585559 reported by Igor Shishkin
6
This bug affects 1 person
Affects Status Importance Assigned to Milestone
Fuel for OpenStack
Fix Released
Low
Fuel Infra Apps

Bug Description

Hi,

I've the following issue with LP-reports:

When mongodb in replicaset elects new primary lpreports doesn't catch it up until restart which causes app failure:

Traceback (most recent call last):
  File "/usr/lib/python2.7/dist-packages/flask/app.py", line 1836, in __call__
    return self.wsgi_app(environ, start_response)
  File "/usr/lib/python2.7/dist-packages/flask/app.py", line 1820, in wsgi_app
    response = self.make_response(self.handle_exception(e))
  File "/usr/lib/python2.7/dist-packages/flask_restful/__init__.py", line 270, in error_router
    return original_handler(e)
  File "/usr/lib/python2.7/dist-packages/flask/app.py", line 1403, in handle_exception
    reraise(exc_type, exc_value, tb)
  File "/usr/lib/python2.7/dist-packages/flask/app.py", line 1817, in wsgi_app
    response = self.full_dispatch_request()
  File "/usr/lib/python2.7/dist-packages/flask/app.py", line 1477, in full_dispatch_request
    rv = self.handle_user_exception(e)
  File "/usr/lib/python2.7/dist-packages/flask_restful/__init__.py", line 270, in error_router
    return original_handler(e)
  File "/usr/lib/python2.7/dist-packages/flask/app.py", line 1381, in handle_user_exception
    reraise(exc_type, exc_value, tb)
  File "/usr/lib/python2.7/dist-packages/flask/app.py", line 1475, in full_dispatch_request
    rv = self.dispatch_request()
  File "/usr/lib/python2.7/dist-packages/flask/app.py", line 1461, in dispatch_request
    return self.view_functions[rule.endpoint](**req.view_args)
  File "/usr/lib/python2.7/dist-packages/lpreports/auth.py", line 108, in authorized
    db.add_user(user, update=update)
  File "/usr/lib/python2.7/dist-packages/lpreports/db.py", line 87, in add_user
    store.update({"_id": user["_id"]}, user)
  File "/usr/lib/python2.7/dist-packages/pymongo/collection.py", line 2230, in update
    with self._socket_for_writes() as sock_info:
  File "/usr/lib/python2.7/contextlib.py", line 17, in __enter__
    return self.gen.next()
  File "/usr/lib/python2.7/dist-packages/pymongo/mongo_client.py", line 712, in _get_socket
    server = self._get_topology().select_server(selector)
  File "/usr/lib/python2.7/dist-packages/pymongo/topology.py", line 141, in select_server
    address))
  File "/usr/lib/python2.7/dist-packages/pymongo/topology.py", line 117, in select_servers
    self._error_message(selector))
pymongo.errors.ServerSelectionTimeoutError: No primary available for writes

Revision history for this message
Alexander Charykov (acharykov) wrote :

We don't support mongodb replica set. We'll look this at this when when we would have time to make application able to run on several nodes and support multiple connections to mongodb.

information type: Private → Public
Changed in fuel:
status: New → Confirmed
importance: High → Low
Revision history for this message
Igor Shishkin (teran) wrote :

Unfortunately you can't say you don't support it since you that concept we had just from the start of migration process and it's discussed design for production run.

Revision history for this message
Fuel Devops McRobotson (fuel-devops-robot) wrote : Related fix proposed to fuel-infra/puppet-manifests (master)

Related fix proposed to branch: master
Change author: Igor Shishkin <email address hidden>
Review: https://review.fuel-infra.org/21260

Changed in fuel:
status: Confirmed → In Progress
Igor Shishkin (teran)
Changed in fuel:
status: In Progress → Confirmed
Revision history for this message
Fuel Devops McRobotson (fuel-devops-robot) wrote : Related fix merged to fuel-infra/puppet-manifests (master)

Reviewed: https://review.fuel-infra.org/21260
Submitter: Igor Shishkin <email address hidden>
Branch: master

Commit: c6ca495f34a1d695c35e9db36a7d44053e7df690
Author: Igor Shishkin <email address hidden>
Date: Thu May 26 08:33:21 2016

Fix for lpreports issue with refreshing mongo rs state on uwsgi side

Change-Id: I84b613d1cf6b755e73cdb4e314c5092e5732bd43
Related-Bug: #1585559
Signed-off-by: Igor Shishkin <email address hidden>

Changed in fuel:
status: Confirmed → Fix Released
To post a comment you must log in.
This report contains Public information  
Everyone can see this information.

Other bug subscribers

Remote bug watches

Bug watches keep track of this bug in other bug trackers.