Details

    • Sub-task
    • Status: Closed
    • Major
    • Resolution: Fixed
    • 0.99.0, 0.98.6.1, 2.0.0
    • 0.99.2
    • Client
    • None
    • Reviewed
    • Hide
      The Interceptor Framework can be used to modify the behavior of retrying client calls on the client side without altering the core of the client code. This framework gives reasonable flexibility with little intrusion.

      An example use case of the interceptor is to have a custom sleep strategy within retries. We can consider a simple accounting system where we have a time spent quota on the client side for the servers. And we would want to error some of the calls if we have consumed the server's quota already.

      Interceptor.intercept() {
       // would keep track the start time.
       server = getServer()
        // Throw if we already spent a lot of time on a server.
        timeSpentOnServer = getTimeSpentSinceLastReset(server)
        if ( timeSpentOnServer > THRESHOLD) throw new Exception("We spend too long on this server")
        setServerStartTime(server)
      }

      Interceptor.handleFailure() {
        server = getServer()
        updateTimeSpentOnServer(server)
      }

      Interceptor.updateFailureInfo() {
        server = getServer()
        updateTimeSpentOnServer(server)
      }
      Show
      The Interceptor Framework can be used to modify the behavior of retrying client calls on the client side without altering the core of the client code. This framework gives reasonable flexibility with little intrusion. An example use case of the interceptor is to have a custom sleep strategy within retries. We can consider a simple accounting system where we have a time spent quota on the client side for the servers. And we would want to error some of the calls if we have consumed the server's quota already. Interceptor.intercept() {  // would keep track the start time.  server = getServer()   // Throw if we already spent a lot of time on a server.   timeSpentOnServer = getTimeSpentSinceLastReset(server)   if ( timeSpentOnServer > THRESHOLD) throw new Exception("We spend too long on this server")   setServerStartTime(server) } Interceptor.handleFailure() {   server = getServer()   updateTimeSpentOnServer(server) } Interceptor.updateFailureInfo() {   server = getServer()   updateTimeSpentOnServer(server) }

    Description

      In multi threaded clients, we use a feature developed on 0.89-fb branch called Preemptive Fast Fail. This allows the client threads which would potentially fail, fail fast. The idea behind this feature is that we allow, among the hundreds of client threads, one thread to try and establish connection with the regionserver and if that succeeds, we mark it as a live node again. Meanwhile, other threads which are trying to establish connection to the same server would ideally go into the timeouts which is effectively unfruitful. We can in those cases return appropriate exceptions to those clients instead of letting them retry.

      Attachments

        1. 0001-Add-a-test-case-for-Preemptive-Fast-Fail.patch
          7 kB
          Manukranth Kolloju
        2. 0001-HBASE-12075-Implement-Preemptive-Fast-Fail.patch
          101 kB
          Manukranth Kolloju
        3. 0001-HBASE-12075-Implement-Preemptive-Fast-Fail.patch
          100 kB
          Manukranth Kolloju
        4. 0001-HBASE-12075-Implement-Preemptive-Fast-Fail.patch
          96 kB
          Manukranth Kolloju
        5. 0001-HBASE-12075-Implement-Preemptive-Fast-Fail.patch
          96 kB
          Manukranth Kolloju
        6. 0001-HBASE-12075-Implement-Preemptive-Fast-Fail.patch
          96 kB
          Manukranth Kolloju
        7. 0001-HBASE-12075-Implement-Preemptive-Fast-Fail.patch
          96 kB
          Manukranth Kolloju
        8. 0001-HBASE-12075-Implement-Preemptive-Fast-Fail.patch
          89 kB
          Michael Stack
        9. 0001-HBASE-12075-Implement-Preemptive-Fast-Fail.patch
          89 kB
          Manukranth Kolloju
        10. 0001-Implement-Preemptive-Fast-Fail.patch
          87 kB
          Manukranth Kolloju
        11. 0001-Implement-Preemptive-Fast-Fail.patch
          86 kB
          Manukranth Kolloju
        12. 0001-Implement-Preemptive-Fast-Fail.patch
          87 kB
          Manukranth Kolloju
        13. 0001-Implement-Preemptive-Fast-Fail.patch
          69 kB
          Manukranth Kolloju
        14. 0001-Implement-Preemptive-Fast-Fail.patch
          69 kB
          Manukranth Kolloju
        15. HBASE-12075-Preemptive-Fast-Fail-V15.patch
          101 kB
          Manukranth Kolloju

        Issue Links

          Activity

            People

              manukranthk Manukranth Kolloju
              manukranthk Manukranth Kolloju
              Votes:
              0 Vote for this issue
              Watchers:
              16 Start watching this issue

              Dates

                Created:
                Updated:
                Resolved: