[
https://issues.apache.org/jira/browse/HDDS-1672?focusedWorklogId=264008&page=com.atlassian.jira.plugin.system.issuetabpanels:worklog-tabpanel#worklog-264008
]
ASF GitHub Bot logged work on HDDS-1672:
----------------------------------------
Author: ASF GitHub Bot
Created on: 20/Jun/19 18:27
Start Date: 20/Jun/19 18:27
Worklog Time Spent: 10m
Work Description: arp7 commented on pull request #949: HDDS-1672. Improve
locking in OzoneManager.
URL: https://github.com/apache/hadoop/pull/949#discussion_r295928452
##########
File path:
hadoop-ozone/ozone-manager/src/main/java/org/apache/hadoop/ozone/om/request/volume/OMVolumeDeleteRequest.java
##########
@@ -104,37 +104,23 @@ public OMClientResponse
validateAndUpdateCache(OzoneManager ozoneManager,
OmVolumeArgs omVolumeArgs = null;
String owner = null;
-
+ IOException exception = null;
+ OzoneManagerProtocolProtos.VolumeList newVolumeList = null;
omMetadataManager.getLock().acquireVolumeLock(volume);
try {
owner = getVolumeInfo(omMetadataManager, volume).getOwnerName();
- } catch (IOException ex) {
- LOG.error("Volume deletion failed for volume:{}", volume, ex);
- omMetrics.incNumVolumeDeleteFails();
- auditLog(auditLogger, buildAuditMessage(OMAction.DELETE_VOLUME,
- buildVolumeAuditMap(volume), ex, userInfo));
- return new OMVolumeDeleteResponse(null, null, null,
- createErrorOMResponse(omResponse, ex));
- } finally {
- omMetadataManager.getLock().releaseVolumeLock(volume);
- }
- // Release and reacquire lock for now it will not be a problem for now, as
- // applyTransaction serializes the operation's.
- // TODO: Revisit this logic once HDDS-1672 checks in.
+ // Release and reacquire lock for now it will not be a problem for now,
as
+ // applyTransaction serializes the operation's.
- // We cannot acquire user lock holding volume lock, so released volume
- // lock, and acquiring user and volume lock.
+ // We cannot acquire user lock holding volume lock, so released volume
Review comment:
Obsolete comment?
----------------------------------------------------------------
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
For queries about this service, please contact Infrastructure at:
[email protected]
Issue Time Tracking
-------------------
Worklog Id: (was: 264008)
Time Spent: 5h (was: 4h 50m)
> Improve locking in OzoneManager
> -------------------------------
>
> Key: HDDS-1672
> URL: https://issues.apache.org/jira/browse/HDDS-1672
> Project: Hadoop Distributed Data Store
> Issue Type: Improvement
> Components: Ozone Manager
> Affects Versions: 0.4.0
> Reporter: Bharat Viswanadham
> Assignee: Bharat Viswanadham
> Priority: Major
> Labels: pull-request-available
> Attachments: Ozone Locks in OM.pdf
>
> Time Spent: 5h
> Remaining Estimate: 0h
>
> In this Jira, we shall follow the new lock ordering. In this way, in volume
> requests we can solve the issue of acquire/release/reacquire problem. And few
> bugs in the current implementation of S3Bucket/Volume operations.
>
> Currently after acquiring volume lock, we cannot acquire user lock.
> This is causing an issue in Volume request implementation,
> acquire/release/reacquire volume lock.
>
> Case of Delete Volume Request:
> # Acquire volume lock.
> # Get Volume Info from DB
> # Release Volume lock. (We are releasing the lock, because while acquiring
> volume lock, we cannot acquire user lock0
> # Get owner from volume Info read from DB
> # Acquire owner lock
> # Acquire volume lock
> # Do delete logic
> # release volume lock
> # release user lock
>
> We can avoid this acquire/release/reacquire lock issue by making volume lock
> as low weight.
>
> In this way, the above deleteVolume request will change as below
> # Acquire volume lock
> # Get Volume Info from DB
> # Get owner from volume Info read from DB
> # Acquire owner lock
> # Do delete logic
> # release owner lock
> # release volume lock.
> Same issue is seen with SetOwner for Volume request also.
> During HDDS-1620 [~arp] brought up this issue.
> I am proposing the above solution to solve this issue. Any other
> idea/suggestions are welcome.
> This also resolves a bug in setOwner for Volume request.
--
This message was sent by Atlassian JIRA
(v7.6.3#76005)
---------------------------------------------------------------------
To unsubscribe, e-mail: [email protected]
For additional commands, e-mail: [email protected]