hadoop-hdfs-issues mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Íñigo Goiri (Jira) <j...@apache.org>
Subject [jira] [Commented] (HDFS-14777) RBF: Set ReadOnly is failing for mount Table but actually readonly succed to set
Date Thu, 29 Aug 2019 17:46:00 GMT

    [ https://issues.apache.org/jira/browse/HDFS-14777?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=16918809#comment-16918809

Íñigo Goiri commented on HDFS-14777:

I have to say that all the ifs related to quotas are getting unreadable.
The main one is:
if (mountTable != null
    && router.isQuotaEnabled()
    && (nsQuota != mountTable.getQuota().getQuota() || ssQuota != mountTable
       .getQuota().getSpaceQuota())) {
   synchronizeQuota(mountTable.getSourcePath(), mountTable.getQuota()
       .getQuota(), mountTable.getQuota().getSpaceQuota());
I think it would be more readable to do:
if (mountTable != null && router.isQuotaEnabled()) {
  RouterQuotaUsage mountQuota = mountTable.getQuota();
  if (nsQuota != mountQuota.getQuota() || ssQuota != mountQuota.getSpaceQuota()) {
        mountQuota.getQuota(), mountQuota.getSpaceQuota());
We could even go further and use a function for {{nsQuota != mountQuota.getQuota() || ssQuota
!= mountQuota.getSpaceQuota()}}.
We could also do a function for:

private RouterQuotaUsage getQuota() {
  // If not available
    return emptyQuota;
  MountTable entry = mResolver.getMountPoint(path);
  return entry.getQuota();
Anyway, take a pass to this and see if we can make it easier to read.

For the log, let's take the chance to fix the toString() with:
LOG.warn("Unable to reset quota at the destinations for {}: {}", request.getEntry(), e.getMessage());

> RBF: Set ReadOnly is failing for mount Table but actually readonly succed to set
> --------------------------------------------------------------------------------
>                 Key: HDFS-14777
>                 URL: https://issues.apache.org/jira/browse/HDFS-14777
>             Project: Hadoop HDFS
>          Issue Type: Bug
>            Reporter: Ranith Sardar
>            Assignee: Ranith Sardar
>            Priority: Major
>         Attachments: HDFS-14777.001.patch, HDFS-14777.002.patch
> # hdfs dfsrouteradmin -update /test hacluster /test -readonly /opt/client # hdfs dfsrouteradmin
-update /test hacluster /test -readonly update: /test is in a read only mount pointorg.apache.hadoop.ipc.RemoteException(java.io.IOException):
/test is in a read only mount point at org.apache.hadoop.hdfs.server.federation.router.RouterRpcServer.getLocationsForPath(RouterRpcServer.java:1419)
at org.apache.hadoop.hdfs.server.federation.router.Quota.getQuotaRemoteLocations(Quota.java:217)
at org.apache.hadoop.hdfs.server.federation.router.Quota.setQuota(Quota.java:75) at org.apache.hadoop.hdfs.server.federation.router.RouterAdminServer.synchronizeQuota(RouterAdminServer.java:288)
at org.apache.hadoop.hdfs.server.federation.router.RouterAdminServer.updateMountTableEntry(RouterAdminServer.java:267)

This message was sent by Atlassian Jira

To unsubscribe, e-mail: hdfs-issues-unsubscribe@hadoop.apache.org
For additional commands, e-mail: hdfs-issues-help@hadoop.apache.org

View raw message