You are viewing a plain text version of this content. The canonical link for it is here.
Posted to common-issues@hadoop.apache.org by GitBox <gi...@apache.org> on 2019/07/16 23:55:08 UTC
[GitHub] [hadoop] arp7 commented on a change in pull request #1088:
HDDS-1689. Implement S3 Create Bucket request to use Cache and DoubleBuffer.
arp7 commented on a change in pull request #1088: HDDS-1689. Implement S3 Create Bucket request to use Cache and DoubleBuffer.
URL: https://github.com/apache/hadoop/pull/1088#discussion_r304172499
##########
File path: hadoop-ozone/ozone-manager/src/main/java/org/apache/hadoop/ozone/om/request/volume/OMVolumeCreateRequest.java
##########
@@ -145,28 +136,24 @@ public OMClientResponse validateAndUpdateCache(OzoneManager ozoneManager,
try {
acquiredUserLock = omMetadataManager.getLock().acquireLock(USER_LOCK,
owner);
+ String dbVolumeKey = omMetadataManager.getVolumeKey(volume);
+
OmVolumeArgs dbVolumeArgs =
omMetadataManager.getVolumeTable().get(dbVolumeKey);
- // Validation: Check if volume already exists
- if (dbVolumeArgs != null) {
+ if (dbVolumeArgs == null) {
+ String dbUserKey = omMetadataManager.getUserKey(owner);
+ volumeList = addVolumeToOwnerList(volumeList, volume, owner,
+ ozoneManager.getMaxUserVolumeCount());
+ createVolume(omMetadataManager, omVolumeArgs, volumeList, dbVolumeKey,
+ dbUserKey, transactionLogIndex);
+ LOG.debug("volume:{} successfully created", omVolumeArgs.getVolume());
+ } else {
LOG.debug("volume:{} already exists", omVolumeArgs.getVolume());
throw new OMException("Volume already exists",
OMException.ResultCodes.VOLUME_ALREADY_EXISTS);
}
- volumeList = omMetadataManager.getUserTable().get(dbUserKey);
Review comment:
Was this line of code lost?
----------------------------------------------------------------
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:
users@infra.apache.org
With regards,
Apache Git Services
---------------------------------------------------------------------
To unsubscribe, e-mail: common-issues-unsubscribe@hadoop.apache.org
For additional commands, e-mail: common-issues-help@hadoop.apache.org