Browse Source

Merge "Add asynchronous error info into messages when share extend error" into stable/stein

tags/8.1.3^0
Zuul 3 weeks ago
committed by Gerrit Code Review
parent
commit
ef79a1df75
3 changed files with 23 additions and 3 deletions
  1. +11
    -2
      manila/message/message_field.py
  2. +7
    -1
      manila/share/manager.py
  3. +5
    -0
      releasenotes/notes/bug-1850264-add-async-error-when-share-extend-error-a0c458204b395994.yaml

+ 11
- 2
manila/message/message_field.py View File

@@ -31,13 +31,15 @@ class Action(object):
UPDATE = ('005', _('update'))
REVERT_TO_SNAPSHOT = ('006', _('revert to snapshot'))
DELETE = ('007', _('delete'))
EXTEND = ('008', _('extend'))
ALL = (ALLOCATE_HOST,
CREATE,
DELETE_ACCESS_RULES,
PROMOTE,
UPDATE,
REVERT_TO_SNAPSHOT,
DELETE)
DELETE,
EXTEND)


class Detail(object):
@@ -72,6 +74,12 @@ class Detail(object):
FILTER_JSON = ('012', FILTER_MSG % 'Json')
FILTER_RETRY = ('013', FILTER_MSG % 'Retry')
FILTER_REPLICATION = ('014', FILTER_MSG % 'ShareReplication')
DRIVER_FAILED_EXTEND = (
'015',
_("Share Driver failed to extend share, The share status has been "
"set to extending_error. This action cannot be re-attempted until "
"the status has been rectified. Contact your administrator to "
"determine the cause of this failure."))

ALL = (UNKNOWN_ERROR,
NO_VALID_HOST,
@@ -86,7 +94,8 @@ class Detail(object):
FILTER_IGNORE,
FILTER_JSON,
FILTER_RETRY,
FILTER_REPLICATION)
FILTER_REPLICATION,
DRIVER_FAILED_EXTEND)

# Exception and detail mappings
EXCEPTION_DETAIL_MAPPINGS = {


+ 7
- 1
manila/share/manager.py View File

@@ -3800,7 +3800,13 @@ class ShareManager(manager.SchedulerDependentManager):
share_instance, new_size, share_server=share_server)
except Exception as e:
LOG.exception("Extend share failed.", resource=share)

self.message_api.create(
context,
message_field.Action.EXTEND,
project_id,
resource_type=message_field.Resource.SHARE,
resource_id=share_id,
detail=message_field.Detail.DRIVER_FAILED_EXTEND)
try:
self.db.share_update(
context, share['id'],


+ 5
- 0
releasenotes/notes/bug-1850264-add-async-error-when-share-extend-error-a0c458204b395994.yaml View File

@@ -0,0 +1,5 @@
---
fixes:
- |
A new user message has been added in case of share extensions failing
asynchronously.

Loading…
Cancel
Save