Uploaded image for project: 'Hadoop HDFS'
  1. Hadoop HDFS
  2. HDFS-12943 Consistent Reads from Standby Node
  3. HDFS-14116

Fix class cast error in NNThroughputBenchmark with ObserverReadProxyProvider.

    XMLWordPrintableJSON

    Details

    • Type: Sub-task
    • Status: Resolved
    • Priority: Major
    • Resolution: Fixed
    • Affects Version/s: None
    • Fix Version/s: HDFS-12943, 3.3.0
    • Component/s: hdfs-client
    • Labels:
      None
    • Target Version/s:
    • Hadoop Flags:
      Reviewed

      Description

      Currently in ObserverReadProxyProvider constructor there is this line

      ((ClientHAProxyFactory<T>) factory).setAlignmentContext(alignmentContext);
      

      This could potentially cause failure, because it is possible that factory can not be casted here. Specifically, NameNodeProxiesClient.createFailoverProxyProvider is where the constructor will be called, and there are two paths that could call into this:
      (1).NameNodeProxies.createProxy
      (2).NameNodeProxiesClient.createFailoverProxyProvider

      (2) works fine because it always uses ClientHAProxyFactory but (1) uses NameNodeHAProxyFactory which can not be casted to ClientHAProxyFactory, this happens when, for example, running NNThroughputBenmarck. To fix this we can at least:
      1. introduce setAlignmentContext to HAProxyFactory which is the parent of both ClientHAProxyFactory and NameNodeHAProxyFactory OR
      2. only setAlignmentContext when it is ClientHAProxyFactory by, say, having a if check with reflection.
      Depending on whether it make sense to have alignment context for the case (1) calling code paths.

        Attachments

        1. HDFS-14116-HDFS-12943.000.patch
          4 kB
          Chao Sun
        2. HDFS-14116-HDFS-12943.001.patch
          16 kB
          Chao Sun
        3. HDFS-14116-HDFS-12943.002.patch
          16 kB
          Chao Sun
        4. HDFS-14116-HDFS-12943.003.patch
          16 kB
          Chao Sun
        5. HDFS-14116-HDFS-12943.004.patch
          16 kB
          Chao Sun
        6. HDFS-14116-HDFS-12943.005.patch
          3 kB
          Konstantin Shvachko

          Activity

            People

            • Assignee:
              csun Chao Sun
              Reporter:
              vagarychen Chen Liang
            • Votes:
              0 Vote for this issue
              Watchers:
              4 Start watching this issue

              Dates

              • Created:
                Updated:
                Resolved: