Duplicate marker regex fails to match (HTTP 503)

Bug #1211386 reported by Allele Dev
6
This bug affects 1 person
Affects Status Importance Assigned to Milestone
zaqar
Fix Released
Critical
Flavio Percoco

Bug Description

When a duplicate key is detected prior to insertion, the storage driver is supposed to know how to extract the marker for that key from the error string.

Since recent updates, the regex has started failing as follows:

'''
2013-08-12 10:52:13.361 24036 ERROR marconi.transport.wsgi.messages [-] Error message could not be parsed: E11000 duplicate key error index: marconi.messages.$queue_marker dup key: { : "q16", : "806067", : 95 }
2013-08-12 10:52:13.361 24036 TRACE marconi.transport.wsgi.messages Traceback (most recent call last):
2013-08-12 10:52:13.361 24036 TRACE marconi.transport.wsgi.messages File "/usr/lib/python2.6/site-packages/marconi/transport/wsgi/messages.py", line 168, in on_post
2013-08-12 10:52:13.361 24036 TRACE marconi.transport.wsgi.messages client_uuid=uuid)
2013-08-12 10:52:13.361 24036 TRACE marconi.transport.wsgi.messages File "/usr/lib/python2.6/site-packages/marconi/storage/mongodb/utils.py", line 166, in wrapper
2013-08-12 10:52:13.361 24036 TRACE marconi.transport.wsgi.messages return func(*args, **kwargs)
2013-08-12 10:52:13.361 24036 TRACE marconi.transport.wsgi.messages File "/usr/lib/python2.6/site-packages/marconi/storage/mongodb/messages.py", line 553, in post
2013-08-12 10:52:13.361 24036 TRACE marconi.transport.wsgi.messages duplicate_marker = utils.dup_marker_from_error(str(ex))
2013-08-12 10:52:13.361 24036 TRACE marconi.transport.wsgi.messages File "/usr/lib/python2.6/site-packages/marconi/storage/mongodb/utils.py", line 49, in dup_marker_from_error
2013-08-12 10:52:13.361 24036 TRACE marconi.transport.wsgi.messages raise exceptions.PatternNotFound(description)
2013-08-12 10:52:13.361 24036 TRACE marconi.transport.wsgi.messages PatternNotFound: Error message could not be parsed: E11000 duplicate key error index: marconi.messages.$queue_marker dup key: { : "q16", : "806067", : 95 }
2013-08-12 10:52:13.361 24036 TRACE marconi.transport.wsgi.messages
'''

Revision history for this message
Kurt Griffiths (kgriffs) wrote :

Duplicate key errors are expected when the service attempts to process multiple inserts in parallel, and two messages end up with the same marker. Normally this situation is handled with retry logic, but it looks like the regex in the logic is borked.

Changed in marconi:
importance: Undecided → Critical
Changed in marconi:
status: New → Confirmed
Revision history for this message
Malini Kamalambal (malini-pk) wrote :

This can be consistently repro-d by running the tsung load tests

Kurt Griffiths (kgriffs)
Changed in marconi:
assignee: nobody → Flavio Percoco (flaper87)
Revision history for this message
OpenStack Infra (hudson-openstack) wrote : Fix proposed to marconi (master)

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

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

Reviewed: https://review.openstack.org/41509
Committed: http://github.com/stackforge/marconi/commit/60150f4667abdca7a2999145938f37e2fa808028
Submitter: Jenkins
Branch: master

commit 60150f4667abdca7a2999145938f37e2fa808028
Author: Flaper Fesp <email address hidden>
Date: Mon Aug 12 21:57:04 2013 +0200

    Fixes unique constraint regex

    This patch fixes the regex being used to extract the marker from the
    unique index error. The issue was caused because we introduced project
    to the queue_marker index and it wasn't being considered in that regex.

    This regex is more general. It matches the index name and gets the
    marker from the end of the error message.

    Change-Id: I02bc153636f10bc49b8634fc4bfeb4bf2b6d6597
    Closes-bug: #1211386

Changed in marconi:
status: In Progress → Fix Committed
Revision history for this message
Malini Kamalambal (malini-pk) wrote :

Fix Verified

Changed in marconi:
status: Fix Committed → Fix Released
milestone: none → havana-3
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.