Uploaded image for project: 'HBase'
  1. HBase
  2. HBASE-18169 Coprocessor fix and cleanup before 2.0.0 release
  3. HBASE-18770

Remove bypass method in ObserverContext and implement the 'bypass' logic case by case

    XMLWordPrintableJSON

    Details

    • Type: Sub-task
    • Status: Resolved
    • Priority: Critical
    • Resolution: Fixed
    • Affects Version/s: None
    • Fix Version/s: 2.0.0-alpha-4, 2.0.0
    • Component/s: Coprocessors
    • Labels:
      None
    • Hadoop Flags:
      Reviewed
    • Release Note:
      Hide
      Removes blanket bypass mechanism (Observer#bypass). Instead, a curated subset of methods are bypassable.

          Changes Coprocessor ObserverContext 'bypass' semantic. We flip the
          default so bypass is NOT supported on Observer invocations; only a
          couple of preXXX methods in RegionObserver allow it: e.g. preGet
          and prePut but not preFlush, etc. Everywhere else, we throw
          a Exception if a Coprocessor Observer tries to invoke bypass. Master
          Observers can no longer stop or change move, split, assign, create table, etc.
          preBatchMutate can no longer be bypassed (bypass the finer-grained
          prePut, preDelete, etc. instead)

          Ditto on complete, the mechanism that allowed a Coprocessor
          rule that all subsequent Coprocessors are skipped in an
          invocation chain; now, complete is only available to
          bypassable methods (and Coprocessors will get an exception if
          they try to 'complete' when it is not allowed).

          See javadoc for whether a Coprocessor Observer method supports
          'bypass'. If no mention, 'bypass' is NOT supported.

      The below methods have been marked deprecated in hbase2. We would have liked to have removed them because they use IA.Private parameters but they are in use by CoreCoprocessors or are critical to downstreamers and we have no alternatives to provide currently.

      @Deprecated public boolean prePrepareTimeStampForDeleteVersion(final Mutation mutation, final Cell kv, final byte[] byteNow, final Get get) throws IOException {
                    
      @Deprecated public boolean preWALRestore(final RegionInfo info, final WALKey logKey, final WALEdit logEdit) throws IOException {

      @Deprecated public void postWALRestore(final RegionInfo info, final WALKey logKey, final WALEdit logEdit) throws IOException {
             
      @Deprecated public DeleteTracker postInstantiateDeleteTracker(DeleteTracker result) throws IOException

      Metrics are updated now even if the Coprocessor does a bypass; e.g. The put count is updated even if a Coprocessor bypasses the core put operation (We do it this way so no need for Coprocessors to have access to our core metrics system).
      Show
      Removes blanket bypass mechanism (Observer#bypass). Instead, a curated subset of methods are bypassable.     Changes Coprocessor ObserverContext 'bypass' semantic. We flip the     default so bypass is NOT supported on Observer invocations; only a     couple of preXXX methods in RegionObserver allow it: e.g. preGet     and prePut but not preFlush, etc. Everywhere else, we throw     a Exception if a Coprocessor Observer tries to invoke bypass. Master     Observers can no longer stop or change move, split, assign, create table, etc.     preBatchMutate can no longer be bypassed (bypass the finer-grained     prePut, preDelete, etc. instead)     Ditto on complete, the mechanism that allowed a Coprocessor     rule that all subsequent Coprocessors are skipped in an     invocation chain; now, complete is only available to     bypassable methods (and Coprocessors will get an exception if     they try to 'complete' when it is not allowed).     See javadoc for whether a Coprocessor Observer method supports     'bypass'. If no mention, 'bypass' is NOT supported. The below methods have been marked deprecated in hbase2. We would have liked to have removed them because they use IA.Private parameters but they are in use by CoreCoprocessors or are critical to downstreamers and we have no alternatives to provide currently. @Deprecated public boolean prePrepareTimeStampForDeleteVersion(final Mutation mutation, final Cell kv, final byte[] byteNow, final Get get) throws IOException {                @Deprecated public boolean preWALRestore(final RegionInfo info, final WALKey logKey, final WALEdit logEdit) throws IOException { @Deprecated public void postWALRestore(final RegionInfo info, final WALKey logKey, final WALEdit logEdit) throws IOException {         @Deprecated public DeleteTracker postInstantiateDeleteTracker(DeleteTracker result) throws IOException Metrics are updated now even if the Coprocessor does a bypass; e.g. The put count is updated even if a Coprocessor bypasses the core put operation (We do it this way so no need for Coprocessors to have access to our core metrics system).

      Attachments

      1. HBASE-18770.master.001.patch
        24 kB
        Michael Stack
      2. HBASE-18770.master.002.patch
        37 kB
        Michael Stack
      3. HBASE-18770.master.003.patch
        71 kB
        Michael Stack
      4. HBASE-18770.master.004.patch
        71 kB
        Michael Stack
      5. HBASE-18770.master.005.patch
        71 kB
        Michael Stack
      6. HBASE-18770.master.006.patch
        88 kB
        Michael Stack
      7. HBASE-18770.master.007.patch
        102 kB
        Michael Stack
      8. HBASE-18770.master.008.patch
        141 kB
        Michael Stack
      9. HBASE-18770.master.009.patch
        144 kB
        Michael Stack
      10. HBASE-18770.master.010.patch
        147 kB
        Michael Stack
      11. HBASE-18770.master.011.patch
        157 kB
        Michael Stack
      12. HBASE-18770.master.012.patch
        169 kB
        Michael Stack
      13. HBASE-18770.master.013.patch
        29 kB
        Michael Stack

        Issue Links

          Activity

            People

            • Assignee:
              stack Michael Stack
              Reporter:
              zhangduo Duo Zhang
            • Votes:
              0 Vote for this issue
              Watchers:
              12 Start watching this issue

              Dates

              • Created:
                Updated:
                Resolved: