hbase-issues mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From "stack (JIRA)" <j...@apache.org>
Subject [jira] [Commented] (HBASE-8884) Pluggable RpcScheduler
Date Sat, 06 Jul 2013 22:21:49 GMT

    [ https://issues.apache.org/jira/browse/HBASE-8884?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=13701433#comment-13701433
] 

stack commented on HBASE-8884:
------------------------------

Thank you for digging in on this issue.

Related, our Elliott has suggested that client's just pass over in the request the priority
they think a call should have.  Server-side, a simple implementation would just do what the
client asks.  Later the server could respect or not dependent on context at time of request.

Regards RpcServerInterface, that is a mess -- a vestige left over how rpc used to work so
would suggest you keep away from it (See TODO at top of the class).

Maybe get a Scheduler implementation from Server rather than do this kind of stuff:

{code}
-    return server.callQueue.size();
+    RpcServer.SimpleRpcScheduler scheduler = (RpcServer.SimpleRpcScheduler) server.scheduler;
+    return scheduler.callQueue.size();
{code}

This is kinda ugly: MONITORED_RPC -- it being static final in the class.  Won't it be shared
by master and regionserver when we run standalone w/ all threads in the one jvm?

I am not clear why we are passing in Header here:

-    Call(int id, final BlockingService service, final MethodDescriptor md, Message param,
+    Call(int id, final BlockingService service, final MethodDescriptor md, RequestHeader
header, Message param,

I'd think we would be done w/ header when running Calls?  (Doesn't Connection object have
what you need?)

Maybe write up a one pager on what your plan is.  It'd be easier to decipher your intent and
be able to help instead of reading a patch.

Why we need a CallTask?  Isn't a Call a Task?  Would CallRunner be a better name?  Or what
is it doing?  It is executing/running the call?

Can Scheduler be an Interface that has implementations that the RpcServer makes use of?  Hmm....
I see you do this already:

+   * An interface for RPC request scheduling algorithm.
+   */
+  public interface RpcScheduler {
+
+    void start();
+    void stop();
+
+    /** Dispatches an RPC request asynchronously. */
+    void dispatch(CallTask task) throws IOException, InterruptedException;
+  }

Yeah, just have a protected interface called Scheduler in the RPC package.  What can't we
dispatch a Call?  Why we have to take a CallTask?  What is missing from Call that you need?
 Just add it?

Yeah, move out the Scheduler implemetation into its own class (protected) in the rpc package

Patch is good.

The difference between master and regionserver RpcServer are scheduler parameters -- the pool
sizes?  Could you make a SchedulerConfiguration object that needs to be filled out and passed
to RpcServer constructor?  Or just have a masterschedulerconfiguration and a regionserverschedulerconfiguration
that you pass to the RpcServer on construction?


                
> Pluggable RpcScheduler
> ----------------------
>
>                 Key: HBASE-8884
>                 URL: https://issues.apache.org/jira/browse/HBASE-8884
>             Project: HBase
>          Issue Type: Improvement
>          Components: IPC/RPC
>            Reporter: Chao Shi
>         Attachments: hbase-8884.patch
>
>
> Today, the RPC scheduling mechanism is pretty simple: it execute requests in isolated
thread-pools based on their priority. In the current implementation, all normal get/put requests
are using the same pool. We'd like to add some per-user or per-region level isolation, so
that a misbehaved user/region will not saturate the thread-pool and cause DoS to others easily.
The idea is similar to FairScheduler in MR. The current scheduling code is not standalone
and is mixed with others (Connection#processRequest). The issue is the first step to extract
it to an interface, so that people are free to write and test their own implementations.
> This patch doesn't make it completely pluggable yet, as some parameters are pass from
constructor. This is because HMaster and HRegionServer both use RpcServer and they have different
thread-pool size config. Let me know if you have a solution to this.

--
This message is automatically generated by JIRA.
If you think it was sent incorrectly, please contact your JIRA administrators
For more information on JIRA, see: http://www.atlassian.com/software/jira

Mime
View raw message