events do not work with mysql

Bug #993625 reported by Vincent Hellot
6
This bug affects 1 person
Affects Status Importance Assigned to Milestone
Graphite
Fix Released
Low
Michael Leinartas

Bug Description

Hi,
the code used to query the database to fetch events does not work on mysql.
in http://bazaar.launchpad.net/~graphite-dev/graphite/main/view/head:/webapp/graphite/events/models.py in the find_events function, the query filter:
query = query.filter(tags__iregex=r'\b%s\b' % tag)
suppose that \b is the word boundary operator. On mysql it should be r'[[:<:]]%s[[:>:]]'

More generally: the events code is not fully using the python-tagging module. I'm not a pythonist but it seems that building manually the request to filter by tag is a poor usage of python-tagging.
I've coded a version using fully the tagging module (please excuse me if i missed some known python idioms). It also fixes the issue decribed above. See the attachment

regards

Vincent

Revision history for this message
Vincent Hellot (hellvinz) wrote :
Changed in graphite:
assignee: nobody → Michael Leinartas (mleinartas)
milestone: none → 0.9.10
Revision history for this message
Michael Leinartas (mleinartas) wrote :

Thanks, events was indeed not using the tagging module very well. I've tested and committed your fix for inclusion in 0.9.10

Changed in graphite:
importance: Undecided → Low
status: New → Fix Committed
Changed in graphite:
status: Fix Committed → Fix Released
Revision history for this message
bhardy (bhardy) wrote : Re: Re: [Bug 993625] events do not work with mysql

I will be out of the office and unreachable on 6/7 and 6/8. I will return to the office on 6/11.

Please reach out to the ESM team for any concerns. Thanks.

--Bryant

On May 10, 2012, at 5:03 PM, Michael Leinartas <email address hidden> wrote:

> Thanks, events was indeed not using the tagging module very well. I've
> tested and committed your fix for inclusion in 0.9.10
>
> ** Changed in: graphite
>   Importance: Undecided => Low
>
> ** Changed in: graphite
>       Status: New => Fix Committed
>
> --
> You received this bug notification because you are subscribed to
> Graphite.
> https://bugs.launchpad.net/bugs/993625
>
> Title:
>  events do not work with mysql
>
> Status in Graphite - Enterprise scalable realtime graphing:
>  Fix Committed
>
> Bug description:
>  Hi,
>  the code used to query the database to fetch events does not work on mysql.
>  in http://bazaar.launchpad.net/~graphite-dev/graphite/main/view/head:/webapp/graphite/events/models.py in the find_events function, the query filter:
>  query = query.filter(tags__iregex=r'\b%s\b' % tag)
>  suppose that \b is the word boundary operator. On mysql it should be r'[[:<:]]%s[[:>:]]'
>
>  More generally: the events code is not fully using the python-tagging module. I'm not a pythonist but it seems that building manually the request to filter by tag is a poor usage of python-tagging.
>  I've coded a version using fully the tagging module (please excuse me if i missed some known python idioms). It also fixes the issue decribed above. See the attachment
>
>  regards
>
>  Vincent
>
> To manage notifications about this bug go to:
> https://bugs.launchpad.net/graphite/+bug/993625/+subscriptions

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.