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

Paul Rogers commented on DRILL-4286:
------------------------------------

One more detail on the possible design. While the ZK method described above 
provides a rough read on the state of a drillbit, we still must handle a race 
condition in the Foreman:

* Check if the Drillbit is available, learn that it is.
* Plan a query using the Drillbit
* The Drillbit becomes quiescent
* Try to submit the query, submission fails

The answer is that the Drillbit fragment submission API must be able to reject 
a request from a Foreman. This then introduces more issues to resolve.

The Foreman must handle this condition without failing the query. One solution 
is to postpone physical planning until just before query submission. (It is not 
clear if the query queues hold queries before or after the distribution 
planning phase.) Doing so reduces the window for race conditions, but the still 
will occur (perhaps rarely enough to become a hard-to-find bug.)

So, another mechanism is needed. The Foreman, during distribution planning, 
should send a message to the target Drillbit to reserve a "slot." If any 
Drillbit refuses the request (because it has entered the quiescent state), the 
distribution planner replans the distribution and tries again.

Of course, if the reservation mechanism is in place, then the ZK registration 
is not entirely necessary. However, it is still useful to avoid unnecessary 
query replans that would otherwise occur if registration were the only 
mechanism available. Also, the ZK registration of state, http port and so on 
can be extended to, say, advertise load, advertise available memory, perhaps 
advertise if a metadata cache is available, and so on.

> Have an ability to put server in quiescent mode of operation
> ------------------------------------------------------------
>
>                 Key: DRILL-4286
>                 URL: https://issues.apache.org/jira/browse/DRILL-4286
>             Project: Apache Drill
>          Issue Type: New Feature
>          Components: Execution - Flow
>            Reporter: Victoria Markman
>
> I think drill will benefit from mode of operation that is called "quiescent" 
> in some databases. 
> From IBM Informix server documentation:
> {code}
> Change gracefully from online to quiescent mode
> Take the database server gracefully from online mode to quiescent mode to 
> restrict access to the database server without interrupting current 
> processing. After you perform this task, the database server sets a flag that 
> prevents new sessions from gaining access to the database server. The current 
> sessions are allowed to finish processing. After you initiate the mode 
> change, it cannot be canceled. During the mode change from online to 
> quiescent, the database server is considered to be in Shutdown mode.
> {code}
> This is different from shutdown, when processes are terminated. 



--
This message was sent by Atlassian JIRA
(v6.3.4#6332)

Reply via email to