[MuranoPL] Reporter not always reports last state

Bug #1462270 reported by Dmitry Kubatkin
6
This bug affects 1 person
Affects Status Importance Assigned to Milestone
Murano
Fix Released
Medium
Stan Lagun
Liberty
Fix Released
Medium
Stan Lagun
Mitaka
Fix Released
Medium
Stan Lagun
Newton
Fix Released
Medium
Stan Lagun

Bug Description

With code looking like this:
          - $.instance.agent.call($template, $resources)
          - $._environment.reporter.report($this, 'Deploy IBM MQ complete')
          - If: $.instance.assignFloatingIp
            Then:
              - $address: $.instance.floatingIpAddress
            Else:
              - $address: $.instance.ipAddresses[0]
          - $login: 'administrator'
          - $._environment.reporter.report($this, format('MQ queue named {0} running at RDP {1} with {2}/{3} creds', $.qmgr, $address, $login, $password))
          - $.setAttr(deployed, true)

Sometimes when environment is deployed 'Deploy IBM MQ complete' but not 'MQ queue named...' appears in 'Last operations' field in horizon. Environments has exaclty same configuration.

Revision history for this message
Dmitry Kubatkin (maelnor) wrote :
Changed in murano:
importance: Undecided → Medium
status: New → Confirmed
milestone: none → liberty-1
Revision history for this message
Kirill Zaitsev (kzaitsev) wrote :

Looks like a race-condition.

It can be mitigated, for example by obtaining report-date on engine side, and transferring it, with the rest of the data. This would not eliminate race condition, but might help, because creation-dates would be sorted correctly.

tags: added: api engine
Changed in murano:
milestone: liberty-1 → liberty-2
Changed in murano:
milestone: liberty-2 → liberty-3
Changed in murano:
milestone: liberty-3 → liberty-rc1
Changed in murano:
milestone: liberty-rc1 → liberty-rc2
Changed in murano:
milestone: liberty-rc2 → mitaka-1
Changed in murano:
milestone: mitaka-1 → mitaka-2
Changed in murano:
milestone: mitaka-2 → mitaka-3
Changed in murano:
milestone: mitaka-3 → mitaka-rc1
Changed in murano:
milestone: mitaka-rc1 → newton-1
Stan Lagun (slagun)
Changed in murano:
assignee: nobody → Stan Lagun (slagun)
Revision history for this message
OpenStack Infra (hudson-openstack) wrote : Fix proposed to murano (master)

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

Changed in murano:
status: Confirmed → In Progress
Revision history for this message
OpenStack Infra (hudson-openstack) wrote : Fix proposed to murano (stable/mitaka)

Fix proposed to branch: stable/mitaka
Review: https://review.openstack.org/300415

Revision history for this message
OpenStack Infra (hudson-openstack) wrote : Fix proposed to murano (stable/liberty)

Fix proposed to branch: stable/liberty
Review: https://review.openstack.org/300419

Revision history for this message
OpenStack Infra (hudson-openstack) wrote : Fix merged to murano (stable/mitaka)

Reviewed: https://review.openstack.org/300415
Committed: https://git.openstack.org/cgit/openstack/murano/commit/?id=7411ddbd20e3d82f2cc48983b18a472431d965bc
Submitter: Jenkins
Branch: stable/mitaka

commit 7411ddbd20e3d82f2cc48983b18a472431d965bc
Author: Stan Lagun <email address hidden>
Date: Fri Apr 1 13:59:24 2016 +0300

    Track status report timestamp

    Report status messages were ordered by the time
    they were inserted into database. And that is the
    time they were received and processed not the
    time the report message was generated. So if
    deployment generates reports faster than they
    get processed it can be that they accumulate
    in RabbitMQ and then received by the API not
    in original order. Another possibility is that
    several API instances would get those messages
    and because of the race condition insert them
    into database in wrong order.

    With this fix report timestamp becomes part
    of the report itself and is inserted into "created"
    table column. Thus created is now when the
    report was created, not the database record.

    Change-Id: I1d41d644ed399cb9d58192e567f11187fa2cf593
    Closes-Bug: #1462270

Revision history for this message
OpenStack Infra (hudson-openstack) wrote : Fix merged to murano (stable/liberty)

Reviewed: https://review.openstack.org/300419
Committed: https://git.openstack.org/cgit/openstack/murano/commit/?id=c49931810721128161e8928ba6e1be080f1116f2
Submitter: Jenkins
Branch: stable/liberty

commit c49931810721128161e8928ba6e1be080f1116f2
Author: Stan Lagun <email address hidden>
Date: Fri Apr 1 14:06:42 2016 +0300

    Track status report timestamp

    Report status messages were ordered by the time
    they were inserted into database. And that is the
    time they were received and processed not the
    time the report message was generated. So if
    deployment generates reports faster than they
    get processed it can be that they accumulate
    in RabbitMQ and then received by the API not
    in original order. Another possibility is that
    several API instances would get those messages
    and because of the race condition insert them
    into database in wrong order.

    With this fix report timestamp becomes part
    of the report itself and is inserted into "created"
    table column. Thus created is now when the
    report was created, not the database record.

    Change-Id: I5b705ee95c6fa2275937513aba0bcb0053c0901c
    Closes-Bug: #1462270

Revision history for this message
OpenStack Infra (hudson-openstack) wrote : Fix merged to murano (master)

Reviewed: https://review.openstack.org/300414
Committed: https://git.openstack.org/cgit/openstack/murano/commit/?id=51de28f7a99c4c43a93f01ff237265193510f398
Submitter: Jenkins
Branch: master

commit 51de28f7a99c4c43a93f01ff237265193510f398
Author: Stan Lagun <email address hidden>
Date: Fri Apr 1 13:59:24 2016 +0300

    Track status report timestamp

    Report status messages were ordered by the time
    they were inserted into database. And that is the
    time they were received and processed not the
    time the report message was generated. So if
    deployment generates reports faster than they
    get processed it can be that they accumulate
    in RabbitMQ and then received by the API not
    in original order. Another possibility is that
    several API instances would get those messages
    and because of the race condition insert them
    into database in wrong order.

    With this fix report timestamp becomes part
    of the report itself and is inserted into "created"
    table column. Thus created is now when the
    report was created, not the database record.

    Change-Id: I1d41d644ed399cb9d58192e567f11187fa2cf593
    Closes-Bug: #1462270

Changed in murano:
status: Fix Committed → Fix Released
Revision history for this message
Alexander Tivelkov (ativelkov) wrote :

Still having this kind of behaviour in latest master

Revision history for this message
Alexander Tivelkov (ativelkov) wrote :

Seems like the database has a second-level precision. It looks like the dtaabase schema has to be modified to include datetime(N) column size to include some second fractions.

tags: added: low-hanging-fruit
tags: removed: low-hanging-fruit
Revision history for this message
OpenStack Infra (hudson-openstack) wrote : Change abandoned on murano (stable/mitaka)

Change abandoned by Stan Lagun (<email address hidden>) on branch: stable/mitaka
Review: https://review.openstack.org/311046
Reason: We don't backport database migrations

Revision history for this message
OpenStack Infra (hudson-openstack) wrote : Related fix merged to murano (master)

Reviewed: https://review.openstack.org/311045
Committed: https://git.openstack.org/cgit/openstack/murano/commit/?id=89a4c4cb5af9b22ef07ea5f1ddcff6edd4997623
Submitter: Jenkins
Branch: master

commit 89a4c4cb5af9b22ef07ea5f1ddcff6edd4997623
Author: Stan Lagun <email address hidden>
Date: Fri Apr 29 00:33:34 2016 -0700

    Increase status report messages time resolution

    We use DATETIME SQL type for created/updated columns
    everywhere through the database. In SQL standard
    DATETIME defaults to DATETIME(6) which is 6 digit
    fraction second part. However MySQL defaults it
    to DATETIME(0) for backward compatibility. In result
    status messages timestamps get rounded to the
    second boundary and if there are several status
    messages were generated within a second
    after table sort they might be shown in a different
    order.

    This commit adds MySQL migration that increases
    resolution for the status table and adds subseconds
    to the generated status repor timestamps.

    Change-Id: Ice8c2d82c6a320c7f73c27f4c60c87bef55b8d95
    Related-Bug: #1462270

tags: added: in-stable-mitaka
Revision history for this message
Doug Hellmann (doug-hellmann) wrote : Fix included in openstack/murano 3.0.0.0b1

This issue was fixed in the openstack/murano 3.0.0.0b1 development milestone.

Revision history for this message
Doug Hellmann (doug-hellmann) wrote : Fix included in openstack/murano 2.0.1

This issue was fixed in the openstack/murano 2.0.1 release.

Revision history for this message
Doug Hellmann (doug-hellmann) wrote : Fix included in openstack/murano 1.0.3

This issue was fixed in the openstack/murano 1.0.3 release.

Revision history for this message
OpenStack Infra (hudson-openstack) wrote :

This issue was fixed in the openstack/murano 1.0.3 release.

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.