Mongo guest status check doesn't work with 3.0

Bug #1448185 reported by Doug Shelley
6
This bug affects 1 person
Affects Status Importance Assigned to Milestone
OpenStack DBaaS (Trove)
Fix Released
Medium
Doug Shelley

Bug Description

For Mongo the _get_actual_db_status uses this command:
     mongostat --host <ip addr> -n 1 | grep connected
to check if MongoDB is running. Prior to version 3.0 of Mongo, the mongostat command returned output like this:

connected to: 172.16.200.3
insert query update delete getmore command flushes mapped vsize res faults locked db idx miss % qr|qw ar|aw netIn netOut conn time
    *0 *0 *0 *0 0 1|0 0 80m 342m 51m 0 local:0.0% 0 0|0 0|0 62b 2k 1 15:18:03

In this case, the "grep connected" returns "connected to:..." and the _get_actual_db_status returns RUNNING.

For MongoDB 3.0, the output was changed to this:
insert query update delete getmore command flushes mapped vsize res faults idx miss % qr|qw ar|aw netIn netOut conn time
    *0 *0 *0 *0 0 1|0 0 80.0M 356.0M 49.0M 0 0 0|0 0|0 79b 10k 1 14:56:14

Of note, the "connected to: .." line is no longer emitted and the grep returns NULL so the instance is marked as SHUTDOWN.

I believe we can just check the return code from the output as mongostat (without the "grep connected") will return non-zero if it fails (i.e. the mongo process isn't running or responding).

Doug Shelley (0-doug)
Changed in trove:
assignee: nobody → Doug Shelley (0-doug)
description: updated
Revision history for this message
OpenStack Infra (hudson-openstack) wrote : Fix proposed to trove (master)

Fix proposed to branch: master
Review: https://review.openstack.org/177381

Changed in trove:
status: New → In Progress
Revision history for this message
OpenStack Infra (hudson-openstack) wrote : Fix merged to trove (master)

Reviewed: https://review.openstack.org/177381
Committed: https://git.openstack.org/cgit/openstack/trove/commit/?id=4d16c8384a4add5be637086a7df84205c75cc047
Submitter: Jenkins
Branch: master

commit 4d16c8384a4add5be637086a7df84205c75cc047
Author: Doug Shelley <email address hidden>
Date: Fri Apr 24 14:45:36 2015 -0400

    Fix Mongo status check to work for Mongo 3.0

    As of version 3.0, MongoDB no longer reports "connected as:..." in
    the output of mongostat. This causes the guest agent status checking
    function to not work. This changes it to not grep for connected but
    just check the return code from the mongostat call as it will return
    non-zero if mongo isn't running or reachable.

    Change-Id: If1329a5338ecaffd11919183eda640ee56635794
    Closes-bug: 1448185

Changed in trove:
status: In Progress → Fix Committed
Changed in trove:
milestone: none → liberty-1
importance: Undecided → Medium
Thierry Carrez (ttx)
Changed in trove:
status: Fix Committed → Fix Released
Revision history for this message
OpenStack Infra (hudson-openstack) wrote : Fix proposed to trove (stable/kilo)

Fix proposed to branch: stable/kilo
Review: https://review.openstack.org/195945

Thierry Carrez (ttx)
Changed in trove:
milestone: liberty-1 → 4.0.0
Matt Riedemann (mriedem)
tags: added: kilo-backport-potential
Revision history for this message
OpenStack Infra (hudson-openstack) wrote : Fix merged to trove (stable/kilo)

Reviewed: https://review.openstack.org/195945
Committed: https://git.openstack.org/cgit/openstack/trove/commit/?id=f0b7d34de650d4aeadf84ff86f21e262adc69c84
Submitter: Jenkins
Branch: stable/kilo

commit f0b7d34de650d4aeadf84ff86f21e262adc69c84
Author: Doug Shelley <email address hidden>
Date: Fri Apr 24 14:45:36 2015 -0400

    Fix Mongo status check to work for Mongo 3.0

    As of version 3.0, MongoDB no longer reports "connected as:..." in
    the output of mongostat. This causes the guest agent status checking
    function to not work. This changes it to not grep for connected but
    just check the return code from the mongostat call as it will return
    non-zero if mongo isn't running or reachable.

    Change-Id: If1329a5338ecaffd11919183eda640ee56635794
    Closes-bug: 1448185
    (cherry picked from commit 4d16c8384a4add5be637086a7df84205c75cc047)

tags: added: in-stable-kilo
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.