mongodb replSetGetStatus json issue

Bug #1368373 reported by Ramashri Umale
6
This bug affects 1 person
Affects Status Importance Assigned to Milestone
OpenStack DBaaS (Trove)
Fix Released
High
Ramashri Umale

Bug Description

In versions of mongodb > 2.1 the way timestamp is returned in mongodb json is significantly different from the prior version. It has changed from being represented as
{ t : <time_t>, i : <ordinal> }
to
Timestamp(<time_t>, <ordinal>)
This is relevant when parsing the output of replication status for mongodb cluster.
The current regex (see https://github.com/openstack/trove/blob/master/trove/guestagent/datastore/mongodb/service.py#L268) cleanup cleans up mongo json by replacing functions with proper json format so it may be parsed like proper json. The regex is not strong enough to handle above Timestamp format though and just changes it to <time_t>, <ordinal> which breaks json format.

The suggested solution is to replace it with "<time_t>, <ordinal>" so json format is adhered to...

Changed in trove:
assignee: nobody → Ramashri Umale (ramashri)
Changed in trove:
status: New → Confirmed
importance: Undecided → High
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/120877

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

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

commit f193a9da0532bcc900b67f0700a5efa467822651
Author: rumale <email address hidden>
Date: Thu Sep 11 11:23:54 2014 -0700

    Strengthens the regex for mongodb json functions

    Encloses function args in quotes. abc: Foo(foo, bar)
    changes to abc : "foo, bar". Intent is to prevent
    mongodb json peculiarities from preventing parsing
    of the json

    Change-Id: Iafd81cf74908078155344ef4746632d48c460f6a
    Closes-Bug: #1368373

Changed in trove:
status: In Progress → Fix Committed
Thierry Carrez (ttx)
Changed in trove:
status: Fix Committed → Fix Released
Thierry Carrez (ttx)
Changed in trove:
milestone: juno-rc1 → 2014.2
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.