Skip to content

Instantly share code, notes, and snippets.

@kuenishi
Last active June 25, 2021 09:20
Show Gist options
  • Save kuenishi/1096246b3dfee08668116ebdff679369 to your computer and use it in GitHub Desktop.
Save kuenishi/1096246b3dfee08668116ebdff679369 to your computer and use it in GitHub Desktop.

OM Client Initialization

    OmTransport omTransport = OmTransportFactory.create(conf, ugi, omServiceId);
    this.ozoneManagerClient = TracingUtil.createProxy(
        new OzoneManagerProtocolClientSideTranslatorPB(omTransport,
            clientId.toString()),
        OzoneManagerProtocol.class, conf
        )
    RPC.setProtocolEngine(OzoneConfiguration.of(conf),
        OzoneManagerProtocolPB.class,
        ProtobufRpcEngine.class);

    this.omFailoverProxyProvider = new OMFailoverProxyProvider(conf, ugi,
        omServiceId);
    ...
    this.rpcProxy = createRetryProxy(omFailoverProxyProvider, maxFailovers);

ここまでが初期化

Endpoint processing

==> /opt/hadoop/logs/ozone-ozone-s3g-hostname.example.log <==
2021-06-21 19:22:31,664 [qtp1516500233-515060] WARN org.apache.hadoop.net.NetUtils: Unable to wrap exception of type class org.apache.hadoop.ipc.RpcException: it has no (Str
ing) constructor
java.lang.NoSuchMethodException: org.apache.hadoop.ipc.RpcException.<init>(java.lang.String)
        at java.lang.Class.getConstructor0(Class.java:3082)
        at java.lang.Class.getConstructor(Class.java:1825)
        at org.apache.hadoop.net.NetUtils.wrapWithMessage(NetUtils.java:835)
        at org.apache.hadoop.net.NetUtils.wrapException(NetUtils.java:811)
        at org.apache.hadoop.ipc.Client.getRpcResponse(Client.java:1566)
        at org.apache.hadoop.ipc.Client.call(Client.java:1508)
        at org.apache.hadoop.ipc.Client.call(Client.java:1405)
        at org.apache.hadoop.ipc.ProtobufRpcEngine$Invoker.invoke(ProtobufRpcEngine.java:233)
        at org.apache.hadoop.ipc.ProtobufRpcEngine$Invoker.invoke(ProtobufRpcEngine.java:118)
        at com.sun.proxy.$Proxy86.submitRequest(Unknown Source)
        at sun.reflect.GeneratedMethodAccessor5.invoke(Unknown Source)
        at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43)
        at java.lang.reflect.Method.invoke(Method.java:498)
        at org.apache.hadoop.io.retry.RetryInvocationHandler.invokeMethod(RetryInvocationHandler.java:422)
        at org.apache.hadoop.io.retry.RetryInvocationHandler$Call.invokeMethod(RetryInvocationHandler.java:165)
        at org.apache.hadoop.io.retry.RetryInvocationHandler$Call.invoke(RetryInvocationHandler.java:157)
        at org.apache.hadoop.io.retry.RetryInvocationHandler$Call.invokeOnce(RetryInvocationHandler.java:95)
        at org.apache.hadoop.io.retry.RetryInvocationHandler.invoke(RetryInvocationHandler.java:359)
        at com.sun.proxy.$Proxy86.submitRequest(Unknown Source)
        at org.apache.hadoop.ozone.om.protocolPB.Hadoop3OmTransport.submitRequest(Hadoop3OmTransport.java:80)
        at org.apache.hadoop.ozone.om.protocolPB.OzoneManagerProtocolClientSideTranslatorPB.submitRequest(OzoneManagerProtocolClientSideTranslatorPB.java:220)
        at org.apache.hadoop.ozone.om.protocolPB.OzoneManagerProtocolClientSideTranslatorPB.openKey(OzoneManagerProtocolClientSideTranslatorPB.java:595)
        at org.apache.hadoop.ozone.client.rpc.RpcClient.createKey(RpcClient.java:718)
        at org.apache.hadoop.ozone.client.OzoneBucket.createKey(OzoneBucket.java:491)
        at org.apache.hadoop.ozone.s3.endpoint.ObjectEndpoint.put(ObjectEndpoint.java:192)

実際にRpcExceptionを投げていたのは

Caused by: org.apache.hadoop.ipc.RpcException: RPC response exceeds maximum data length
        at org.apache.hadoop.ipc.Client$IpcStreams.readResponse(Client.java:1894)
        at org.apache.hadoop.ipc.Client$Connection.receiveRpcResponse(Client.java:1191)
        at org.apache.hadoop.ipc.Client$Connection.run(Client.java:1087)

のスタックから推察するに Client.java のここClient がThreadを継承しているこおから非同期RPCのスレッドプールがあって、その中で例外を投げるとこういう風になるんじゃないかと踏んでいる。

      if (maxResponseLength > 0 && length > maxResponseLength) {
        throw new RpcException("RPC response exceeds maximum data length");
      }

この maxResponseLength の由来を追うのが次

  • これはConnectionを初期化するときに remoteId.conf からくる https://github.com/apache/hadoop/blob/rel/release-3.2.2/hadoop-common-
  • ConnectionはClient#getConnectionでnewしている
  • Client#getConnectionは Client#call の中で実行している→この call に remoteId が渡されている
  • ProtobufRpcEngine.Invoker#remoteId がそれに相当する。で、 Invoker#invoke 内でcall()を呼んでいてそれが渡されている
  • Invokerは ProtobufRpcEngine#getProxy() から呼ばれている
  • ということで、大元は OzoneClientProducer#ozoneConfiguration から来ている。

やっぱちゃんと渡ってこないとおかしい感じするよな・・・

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment