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/17 17:30:15 UTC
[GitHub] [hadoop] bharatviswa504 commented on a change in pull request
#1088: HDDS-1689. Implement S3 Create Bucket request to use Cache and
DoubleBuffer.
bharatviswa504 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_r304554453
##########
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:
Thanks for catching. It is a coding mistake. I have fixed it, and also added a test case for it.
----------------------------------------------------------------
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