[ 
https://issues.apache.org/jira/browse/IMPALA-9055?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=16954713#comment-16954713
 ] 

ASF subversion and git services commented on IMPALA-9055:
---------------------------------------------------------

Commit 999becd2522fd9857e49015cf54f01d39ca8123b in impala's branch 
refs/heads/master from Zoltan Borok-Nagy
[ https://gitbox.apache.org/repos/asf?p=impala.git;h=999becd ]

IMPALA-9055: Impala shouldn't set expiration to NEVER for cache directives.

In HdfsCachingUtil we set the expiration of cache directives to never.
This works well until the cache pool has max TTL set. Once max TTL is
set Impala will get an exception when it tries to add caching for tables
or partitions.

I changed HdfsCachingUtil to not set the expiration. This way the cache
directive inherits the expiration from the cache pool.

Testing
Added e2e test that creates a table in a cache pool that has max TTL.

Change-Id: I475b92704b19e337b2e62f766e5b978585bf6583
Reviewed-on: http://gerrit.cloudera.org:8080/14485
Reviewed-by: Csaba Ringhofer <csringho...@cloudera.com>
Reviewed-by: Tim Armstrong <tarmstr...@cloudera.com>
Tested-by: Impala Public Jenkins <impala-public-jenk...@cloudera.com>


> HDFS Caching with Impala: Expiration 26687997791:19:48:13.951 exceeds the max 
> relative expiration time of <maxTtl>
> ------------------------------------------------------------------------------------------------------------------
>
>                 Key: IMPALA-9055
>                 URL: https://issues.apache.org/jira/browse/IMPALA-9055
>             Project: IMPALA
>          Issue Type: Bug
>          Components: Catalog
>            Reporter: Adriano
>            Assignee: Zoltán Borók-Nagy
>            Priority: Major
>
> HDFS Caching with Impala:
> If we create a pool specifying the maxTtl with the hdfs command:
> e.g:
> {{sudo -u hdfs hdfs cacheadmin -addPool foo -owner impala -group hdfs -mode 
> 755 -limit 100000000000  -maxTtl 7d}}
> when we try to alter a table adding a partition in Impala:
> e.g:
> {code:java}
> alter table foo partition (p1=1) set cached in 'foo'
> {code}
> we get a failure with the exception:
> {code:java}
> ERROR: ImpalaRuntimeException: Expiration 26687997791:19:48:13.951 exceeds 
> the max relative expiration time of 604800000 ms.
>       at 
> org.apache.hadoop.hdfs.server.namenode.CacheManager.validateExpiryTime(CacheManager.java:378)
>       at 
> org.apache.hadoop.hdfs.server.namenode.CacheManager.addDirective(CacheManager.java:528)
>       at 
> org.apache.hadoop.hdfs.server.namenode.FSNDNCacheOp.addCacheDirective(FSNDNCacheOp.java:45)
>       at 
> org.apache.hadoop.hdfs.server.namenode.FSNamesystem.addCacheDirective(FSNamesystem.java:6782)
>       at 
> org.apache.hadoop.hdfs.server.namenode.NameNodeRpcServer.addCacheDirective(NameNodeRpcServer.java:1883)
>       at 
> org.apache.hadoop.hdfs.protocolPB.ClientNamenodeProtocolServerSideTranslatorPB.addCacheDirective(ClientNamenodeProtocolServerSideTranslatorPB.java:1265)
>       at 
> org.apache.hadoop.hdfs.protocol.proto.ClientNamenodeProtocolProtos$ClientNamenodeProtocol$2.callBlockingMethod(ClientNamenodeProtocolProtos.java)
>       at 
> org.apache.hadoop.ipc.ProtobufRpcEngine$Server$ProtoBufRpcInvoker.call(ProtobufRpcEngine.java:523)
>       at org.apache.hadoop.ipc.RPC$Server.call(RPC.java:991)
>       at org.apache.hadoop.ipc.Server$RpcCall.run(Server.java:869)
>       at org.apache.hadoop.ipc.Server$RpcCall.run(Server.java:815)
>       at java.security.AccessController.doPrivileged(Native Method)
>       at javax.security.auth.Subject.doAs(Subject.java:422)
>       at 
> org.apache.hadoop.security.UserGroupInformation.doAs(UserGroupInformation.java:1685)
>       at org.apache.hadoop.ipc.Server$Handler.run(Server.java:2675)
> CAUSED BY: InvalidRequestException: Expiration 26687997791:19:48:13.951 
> exceeds the max relative expiration time of 604800000 ms.
>       at 
> org.apache.hadoop.hdfs.server.namenode.CacheManager.validateExpiryTime(CacheManager.java:378)
>       at 
> org.apache.hadoop.hdfs.server.namenode.CacheManager.addDirective(CacheManager.java:528)
>       at 
> org.apache.hadoop.hdfs.server.namenode.FSNDNCacheOp.addCacheDirective(FSNDNCacheOp.java:45)
>       at 
> org.apache.hadoop.hdfs.server.namenode.FSNamesystem.addCacheDirective(FSNamesystem.java:6782)
>       at 
> org.apache.hadoop.hdfs.server.namenode.NameNodeRpcServer.addCacheDirective(NameNodeRpcServer.java:1883)
>       at 
> org.apache.hadoop.hdfs.protocolPB.ClientNamenodeProtocolServerSideTranslatorPB.addCacheDirective(ClientNamenodeProtocolServerSideTranslatorPB.java:1265)
>       at 
> org.apache.hadoop.hdfs.protocol.proto.ClientNamenodeProtocolProtos$ClientNamenodeProtocol$2.callBlockingMethod(ClientNamenodeProtocolProtos.java)
>       at 
> org.apache.hadoop.ipc.ProtobufRpcEngine$Server$ProtoBufRpcInvoker.call(ProtobufRpcEngine.java:523)
>       at org.apache.hadoop.ipc.RPC$Server.call(RPC.java:991)
>       at org.apache.hadoop.ipc.Server$RpcCall.run(Server.java:869)
>       at org.apache.hadoop.ipc.Server$RpcCall.run(Server.java:815)
>       at java.security.AccessController.doPrivileged(Native Method)
>       at javax.security.auth.Subject.doAs(Subject.java:422)
>       at 
> org.apache.hadoop.security.UserGroupInformation.doAs(UserGroupInformation.java:1685)
>       at org.apache.hadoop.ipc.Server$Handler.run(Server.java:2675)
> CAUSED BY: RemoteException: Expiration 26687997791:19:48:13.951 exceeds the 
> max relative expiration time of 604800000 ms.
>       at 
> org.apache.hadoop.hdfs.server.namenode.CacheManager.validateExpiryTime(CacheManager.java:378)
>       at 
> org.apache.hadoop.hdfs.server.namenode.CacheManager.addDirective(CacheManager.java:528)
>       at 
> org.apache.hadoop.hdfs.server.namenode.FSNDNCacheOp.addCacheDirective(FSNDNCacheOp.java:45)
>       at 
> org.apache.hadoop.hdfs.server.namenode.FSNamesystem.addCacheDirective(FSNamesystem.java:6782)
>       at 
> org.apache.hadoop.hdfs.server.namenode.NameNodeRpcServer.addCacheDirective(NameNodeRpcServer.java:1883)
>       at 
> org.apache.hadoop.hdfs.protocolPB.ClientNamenodeProtocolServerSideTranslatorPB.addCacheDirective(ClientNamenodeProtocolServerSideTranslatorPB.java:1265)
>       at 
> org.apache.hadoop.hdfs.protocol.proto.ClientNamenodeProtocolProtos$ClientNamenodeProtocol$2.callBlockingMethod(ClientNamenodeProtocolProtos.java)
>       at 
> org.apache.hadoop.ipc.ProtobufRpcEngine$Server$ProtoBufRpcInvoker.call(ProtobufRpcEngine.java:523)
>       at org.apache.hadoop.ipc.RPC$Server.call(RPC.java:991)
>       at org.apache.hadoop.ipc.Server$RpcCall.run(Server.java:869)
>       at org.apache.hadoop.ipc.Server$RpcCall.run(Server.java:815)
>       at java.security.AccessController.doPrivileged(Native Method)
>       at javax.security.auth.Subject.doAs(Subject.java:422)
>       at 
> org.apache.hadoop.security.UserGroupInformation.doAs(UserGroupInformation.java:1685)
>       at org.apache.hadoop.ipc.Server$Handler.run(Server.java:2675)
> {code}
> this is always reproducible.
> The workaround is to do not set the maxTtl in the hdfs command during the 
> pool creation.
> Here's the repro steps:
> {code:java}
> impala-shell -i <ImpalaD hostname> -q "drop table if exists foo;"
> impala-shell -i <ImpalaD hostname> -q "create table if not exists foo (c1 
> int, c2 string) partitioned by (p1 int) stored as parquet location 
> '/user/hive/warehouse/foo';"
> impala-shell -i <ImpalaD hostname> -q "insert into foo partition (p1 = 1 ) 
> values  (1 ,'one');"
> sudo -u hdfs hdfs cacheadmin -removePool foo
> sudo -u hdfs hdfs cacheadmin -listDirectives -stats
> sudo -u hdfs hdfs cacheadmin -listPools -stats
> sudo -u hdfs hdfs cacheadmin -addPool foo -owner impala -group hdfs -mode 755 
> -limit 100000000000  -maxTtl 7d
> sudo -u hdfs hdfs cacheadmin -addDirective -path /user/hive/warehouse/foo 
> -pool foo -ttl 7d
> sudo -u hdfs hdfs cacheadmin -listDirectives -stats
> sudo -u hdfs hdfs cacheadmin -listPools -stats
> impala-shell -i <ImpalaD hostname> -q "alter table foo set uncached;" 
> sleep 5;
> impala-shell -i <ImpalaD hostname> -q "alter table foo partition (p1=1) set 
> cached in 'foo';" 
> {code}
> I did not found any already open jira for this issue that looks reproducible 
> in many CDH versions, I appreciate if you can take a look on it.



--
This message was sent by Atlassian Jira
(v8.3.4#803005)

---------------------------------------------------------------------
To unsubscribe, e-mail: issues-all-unsubscr...@impala.apache.org
For additional commands, e-mail: issues-all-h...@impala.apache.org

Reply via email to