HBase
  1. HBase
  2. HBASE-5097

RegionObserver implementation whose preScannerOpen and postScannerOpen Impl return null can stall the system initialization through NPE

    Details

    • Type: Bug Bug
    • Status: Closed
    • Priority: Major Major
    • Resolution: Fixed
    • Affects Version/s: None
    • Fix Version/s: 0.92.2, 0.94.0, 0.95.0
    • Component/s: Coprocessors
    • Labels:
      None

      Description

      In HRegionServer.java openScanner()

            r.prepareScanner(scan);
            RegionScanner s = null;
            if (r.getCoprocessorHost() != null) {
              s = r.getCoprocessorHost().preScannerOpen(scan);
            }
            if (s == null) {
              s = r.getScanner(scan);
            }
            if (r.getCoprocessorHost() != null) {
              s = r.getCoprocessorHost().postScannerOpen(scan, s);
            }
      

      If we dont have implemention for postScannerOpen the RegionScanner is null and so throwing nullpointer

      java.lang.NullPointerException
      	at java.util.concurrent.ConcurrentHashMap.put(ConcurrentHashMap.java:881)
      	at org.apache.hadoop.hbase.regionserver.HRegionServer.addScanner(HRegionServer.java:2282)
      	at org.apache.hadoop.hbase.regionserver.HRegionServer.openScanner(HRegionServer.java:2272)
      	at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
      	at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:39)
      	at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:25)
      	at java.lang.reflect.Method.invoke(Method.java:597)
      	at org.apache.hadoop.hbase.ipc.WritableRpcEngine$Server.call(WritableRpcEngine.java:364)
      	at org.apache.hadoop.hbase.ipc.HBaseServer$Handler.run(HBaseServer.java:1326)
      
      

      Making this defect as blocker.. Pls feel free to change the priority if am wrong. Also correct me if my way of trying out coprocessors without implementing postScannerOpen is wrong. Am just a learner.

      1. HBASE-5097.patch
        1 kB
        ramkrishna.s.vasudevan
      2. HBASE-5097_1.patch
        0.8 kB
        ramkrishna.s.vasudevan
      3. HBASE-5097_2.patch
        0.9 kB
        ramkrishna.s.vasudevan

        Activity

        ramkrishna.s.vasudevan created issue -
        ramkrishna.s.vasudevan made changes -
        Field Original Value New Value
        Component/s coprocessors [ 12314191 ]
        ramkrishna.s.vasudevan made changes -
        Priority Blocker [ 1 ] Major [ 3 ]
        Ted Yu made changes -
        Summary Coprocessor RegionObserver implementation without preScannerOpen and postScannerOpen Impl is throwing NPE and so failing the system initialization. RegionObserver implementation whose preScannerOpen and postScannerOpen Impl return null can stall the system initialization through NPE
        ramkrishna.s.vasudevan made changes -
        Assignee ramkrishna.s.vasudevan [ ram_krish ]
        ramkrishna.s.vasudevan made changes -
        Attachment HBASE-5097.patch [ 12508902 ]
        ramkrishna.s.vasudevan made changes -
        Status Open [ 1 ] Patch Available [ 10002 ]
        ramkrishna.s.vasudevan made changes -
        Attachment HBASE-5097_1.patch [ 12509324 ]
        ramkrishna.s.vasudevan made changes -
        Status Patch Available [ 10002 ] Open [ 1 ]
        ramkrishna.s.vasudevan made changes -
        Status Open [ 1 ] Patch Available [ 10002 ]
        ramkrishna.s.vasudevan made changes -
        Status Patch Available [ 10002 ] Open [ 1 ]
        ramkrishna.s.vasudevan made changes -
        Attachment HBASE-5097_2.patch [ 12509434 ]
        ramkrishna.s.vasudevan made changes -
        Fix Version/s 0.92.2 [ 12319888 ]
        Fix Version/s 0.96.0 [ 12320040 ]
        Fix Version/s 0.94.1 [ 12320257 ]
        Lars Hofhansl made changes -
        Fix Version/s 0.94.0 [ 12316419 ]
        Fix Version/s 0.94.1 [ 12320257 ]
        Lars Hofhansl made changes -
        Status Open [ 1 ] Resolved [ 5 ]
        Resolution Fixed [ 1 ]
        Lars Hofhansl made changes -
        Status Resolved [ 5 ] Closed [ 6 ]
        stack made changes -
        Fix Version/s 0.95.0 [ 12324094 ]
        Fix Version/s 0.94.0 [ 12316419 ]
        Fix Version/s 0.92.2 [ 12319888 ]
        Fix Version/s 0.96.0 [ 12320040 ]
        Lars Hofhansl made changes -
        Fix Version/s 0.94.0 [ 12316419 ]
        Lars Hofhansl made changes -
        Fix Version/s 0.94.1 [ 12320257 ]
        Fix Version/s 0.94.0 [ 12316419 ]
        Lars Hofhansl made changes -
        Fix Version/s 0.94.1 [ 12320257 ]
        Fix Version/s 0.94.0 [ 12316419 ]
        stack made changes -
        Fix Version/s 0.92.2 [ 12319888 ]

          People

          • Assignee:
            ramkrishna.s.vasudevan
            Reporter:
            ramkrishna.s.vasudevan
          • Votes:
            0 Vote for this issue
            Watchers:
            4 Start watching this issue

            Dates

            • Created:
              Updated:
              Resolved:

              Development