[mongodb] Message posts are not always atomic

Bug #1270263 reported by Kurt Griffiths on 2014-01-17
This bug affects 1 person
Affects Status Importance Assigned to Milestone
Kurt Griffiths
Kurt Griffiths

Bug Description

Currently, if we lose our network connection to mongod we will return a 503 to the client and a partial enqueuing of the posted message batch is possible.

Kurt Griffiths (kgriffs) on 2014-01-17
description: updated
Changed in marconi:
status: Triaged → In Progress

Reviewed: https://review.openstack.org/67320
Committed: https://git.openstack.org/cgit/openstack/marconi/commit/?id=fc71f6a17e27155b55bd80aa8b67881ed8b6a7a9
Submitter: Jenkins
Branch: master

commit fc71f6a17e27155b55bd80aa8b67881ed8b6a7a9
Author: kgriffs <email address hidden>
Date: Thu Jan 16 17:01:28 2014 -0600

    fix(mongodb): Ensure batch message posts are atomic (all or nothing)

    In the case of a network failure it is not possible to discover which,
    if any, of the messages in a given batch were inserted before the
    outage occurred.

    This patch works around the problem by inserting messages in two

    1. Assign all messages a "batch" or "group" ID and insert them
    2. Once it has been confirmed that *all* messages were inserted
       correctly, finalize the transaction by clearing the batch
       ID, 'g', from the messages just inserted.

    Message listing and counting were also modified to ignore any
    non-finalized messages, i.e., those messages that have a non-null
    'g' value.

    Orphaned messages will eventually expire and be cleaned up as
    usual via the TTL index.

    Closes-Bug: #1270263
    Change-Id: I9de61cdfdf6dfcbe07ef76bf63a293091f087663

Changed in marconi:
status: In Progress → Fix Committed
Thierry Carrez (ttx) on 2014-01-22
Changed in marconi:
status: Fix Committed → Fix Released
Thierry Carrez (ttx) on 2014-04-17
Changed in marconi:
milestone: icehouse-2 → 2014.1
To post a comment you must log in.
This report contains Public information  Edit
Everyone can see this information.

Other bug subscribers