Confusing error message while creating replica instance

Bug #1716853 reported by Fan Zhang
6
This bug affects 1 person
Affects Status Importance Assigned to Milestone
OpenStack DBaaS (Trove)
Fix Released
Low
Fan Zhang

Bug Description

First, I have a ERROR instance which its actual task_id is 82, which means (BUILDING, 'Build error: Volume.')
[root@node-15 root]# trove list
+----------------+-----------+-------------------+--------+
| Name | Datastore | Datastore Version | Status |
-----------------+-----------+-------------------+--------+
| f-test | redis | 3.2 | ERROR |
-----------------+-----------+-------------------+--------+

Then I create a replica instance of it, the error message shows below:
ERROR: Instance e7224fa5-0ea4-429a-aa1c-3400b2a3a6f5 is not currently available for an action to be performed (status was BUILD). (HTTP 422)

Is the status EEROR or BUILD? It is confusing. I think the error message should be more specific that could show instance status or task status based on current codes.

Fan Zhang (fanzhang)
Changed in trove:
assignee: nobody → Fan Zhang (fanzhang)
description: updated
Changed in trove:
status: New → In Progress
Revision history for this message
zhanggang (gangzh) wrote :

when create replica of the f-test instance, it will call validae_can_perform_action method. And the the method first check the server_status. In this case, server_status is "BUILD"(set by method load_simple_instance_server_status).
#######################################################
def load_simple_instance_server_status(context, db_info):
    """Loads a server or raises an exception."""
    if 'BUILDING' == db_info.task_status.action:
        db_info.server_status = "BUILD"
        db_info.addresses = {}
######################################################

The status in the error message is task status, not instance status. Instance status is an integrated status, compare with task status, it does little help for code developer to locate bug.

So, in my opinion, instance status is showed for common user. For developer, raise task status(or service status or servr status)is more friendly.

Revision history for this message
Fan Zhang (fanzhang) wrote :

Yeah, I think that's reasonable. I thought about like server status or service status, but it was too specific. So I made this patch https://review.openstack.org/#/c/503553/ yesterday, changing status into 'instance status' and 'task status'. But right now, I don't think my patch is perfect. We should definitely think through the error message.

And by the way, why my patch url wasn't showed here?

Changed in trove:
importance: Undecided → Low
Revision history for this message
OpenStack Infra (hudson-openstack) wrote : Fix merged to trove (master)

Reviewed: https://review.openstack.org/503553
Committed: https://git.openstack.org/cgit/openstack/trove/commit/?id=32991840882c527010fa6c5a1dc8bd4c803d5082
Submitter: Zuul
Branch: master

commit 32991840882c527010fa6c5a1dc8bd4c803d5082
Author: Fan Zhang <email address hidden>
Date: Wed Sep 13 15:52:46 2017 +0800

    Fix inaccurate message while creating replica

    While creating a replica of an error instance, the error message in
    validate_can_perform_action() is inaccurate and confusing. It should
    be more clear to show which status it is.

    Change-Id: I33f18d672caf0ce687969c825f4999a902891087
    Closes-bug: #1716853
    Signed-off-by: Fan Zhang <email address hidden>

Changed in trove:
status: In Progress → Fix Released
Revision history for this message
OpenStack Infra (hudson-openstack) wrote : Fix included in openstack/trove 9.0.0.0b3

This issue was fixed in the openstack/trove 9.0.0.0b3 development milestone.

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.