From yarn-issues-return-144826-archive-asf-public=cust-asf.ponee.io@hadoop.apache.org Fri May 11 06:18:06 2018 Return-Path: X-Original-To: archive-asf-public@cust-asf.ponee.io Delivered-To: archive-asf-public@cust-asf.ponee.io Received: from mail.apache.org (hermes.apache.org [140.211.11.3]) by mx-eu-01.ponee.io (Postfix) with SMTP id E5C8518063A for ; Fri, 11 May 2018 06:18:05 +0200 (CEST) Received: (qmail 86665 invoked by uid 500); 11 May 2018 04:18:04 -0000 Mailing-List: contact yarn-issues-help@hadoop.apache.org; run by ezmlm Precedence: bulk List-Help: List-Unsubscribe: List-Post: List-Id: Delivered-To: mailing list yarn-issues@hadoop.apache.org Received: (qmail 86653 invoked by uid 99); 11 May 2018 04:18:04 -0000 Received: from pnap-us-west-generic-nat.apache.org (HELO spamd1-us-west.apache.org) (209.188.14.142) by apache.org (qpsmtpd/0.29) with ESMTP; Fri, 11 May 2018 04:18:04 +0000 Received: from localhost (localhost [127.0.0.1]) by spamd1-us-west.apache.org (ASF Mail Server at spamd1-us-west.apache.org) with ESMTP id 2592CC70B6 for ; Fri, 11 May 2018 04:18:04 +0000 (UTC) X-Virus-Scanned: Debian amavisd-new at spamd1-us-west.apache.org X-Spam-Flag: NO X-Spam-Score: -109.501 X-Spam-Level: X-Spam-Status: No, score=-109.501 tagged_above=-999 required=6.31 tests=[ENV_AND_HDR_SPF_MATCH=-0.5, KAM_ASCII_DIVIDERS=0.8, RCVD_IN_DNSWL_MED=-2.3, SPF_PASS=-0.001, USER_IN_DEF_SPF_WL=-7.5, USER_IN_WHITELIST=-100] autolearn=disabled Received: from mx1-lw-eu.apache.org ([10.40.0.8]) by localhost (spamd1-us-west.apache.org [10.40.0.7]) (amavisd-new, port 10024) with ESMTP id 8h6C8wA-tFto for ; Fri, 11 May 2018 04:18:03 +0000 (UTC) Received: from mailrelay1-us-west.apache.org (mailrelay1-us-west.apache.org [209.188.14.139]) by mx1-lw-eu.apache.org (ASF Mail Server at mx1-lw-eu.apache.org) with ESMTP id 4594F5F666 for ; Fri, 11 May 2018 04:18:02 +0000 (UTC) Received: from jira-lw-us.apache.org (unknown [207.244.88.139]) by mailrelay1-us-west.apache.org (ASF Mail Server at mailrelay1-us-west.apache.org) with ESMTP id B3382E0F55 for ; Fri, 11 May 2018 04:18:00 +0000 (UTC) Received: from jira-lw-us.apache.org (localhost [127.0.0.1]) by jira-lw-us.apache.org (ASF Mail Server at jira-lw-us.apache.org) with ESMTP id 275C021546 for ; Fri, 11 May 2018 04:18:00 +0000 (UTC) Date: Fri, 11 May 2018 04:18:00 +0000 (UTC) From: "Wilfred Spiegelenburg (JIRA)" To: yarn-issues@hadoop.apache.org Message-ID: In-Reply-To: References: Subject: [jira] [Commented] (YARN-8191) Fair scheduler: queue deletion without RM restart MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: quoted-printable X-JIRA-FingerPrint: 30527f35849b9dde25b450d4833f0394 [ https://issues.apache.org/jira/browse/YARN-8191?page=3Dcom.atlassian.= jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=3D16471= 471#comment-16471471 ]=20 Wilfred Spiegelenburg commented on YARN-8191: --------------------------------------------- We're almost there. First the simple one: {quote}testRemovalOfDynamicParentQueue needs to cover a dynamic parent queu= e without a leaf is removal. * How can I create a dynamic parent queue without a leaf? I thought the on= ly way to have a parent queue without a leaf is to add it to the allocation= config with parent=3D"true", but in this case it'd be a static queue.{quot= e} It is almost covered in the new test {{testRemovalOfChildlessParentQueue}} = but I want to mimic what happens in the {{onReload}}. BTW: I think we need to swap the two calls around in onReload. First mark = removed queues as dynamic then update so that the queue manager removes the= queues immediately if possible. {quote}We already check all queues defined in the configuration on each rel= oad for existence in the updateAllocationConfiguration via the call to remo= veEmptyIncompatibleQueues. If the queue of the correct type exists we curre= ntly just return. The only thing we should do now before we return is unset= the isDynamic flag there and there is no need for a separate loop. removeE= mptyIncompatibleQueues is called for each configured queue with each reload= . * Sorry, I do not understand what you're suggesting here. Could you please= elaborate a bit more?{quote} Sure I can: When we walk over the list of queues that are loaded from the config in {{= updateAllocationConfiguration}} we call for every queue that is configured = the method {{removeEmptyIncompatibleQueues}}. That method will check if the= queue with that name already exists or not. If the queue exists it also ch= ecks if the queue is of the correct type (parent or leaf) if the queue is o= f the correct type we currently just return: {code:java} FSQueue queue =3D queues.get(queueToCreate); // Queue exists already. if (queue !=3D null) { if (queue instanceof FSLeafQueue) { if (queueType =3D=3D FSQueueType.LEAF) { // if queue is already a leaf then return true return true; } // remove incompatibility since queue is a leaf currently // needs to change to a parent. return removeQueueIfEmpty(queue); } else { if (queueType =3D=3D FSQueueType.PARENT) { return true; } // If it's an existing parent queue and needs to change to leaf,=20 // remove it if it's empty. return removeQueueIfEmpty(queue); } } {code} What I am proposing is to add one line of code per queue type. If the queue= exists and it is the correct type than we should make sure the dynamic fla= g is set to false.That will have no effect if the queue was already defined= in the config. However if the queue was created as a dynamic queue it will= then turn that queue into a queue defined in the configuration. if the que= ue was already In all other cases we remove the queue and create a new one = later on which will have the correct dynamic flag set. So in the above code we would get two lines extra, this is the one for the= LEAF queues: {code:java} if (queueType =3D=3D FSQueueType.LEAF) { queue.setDynamic(false); // if queue is already a leaf then return true return true; } {code} With that change we do not have to do anything in the \{{updateAllocationCo= nfiguration}} for static/dynamic change. Does that make sense? I just noticed two bugs in that code, neither are newly introduced: # if I try to create a LEAF from the config and it is already a LEAF queue= we should not return true but false. Same for the PARENT check. The return= code triggers the queue creation which is not needed because the queue alr= eady exists even with the right type. # if the queue exists with the wrong type we try to remove it via \{{remov= eQueueIfEmpty}} The result is passed back without checks=C2=A0and don't fol= low up. If the remove failed I have a queue with the wrong type in the syst= em. That leaves the system in an inconsistent state: whatever I have in the= queue manager is now not what is in the configuration. This should be at l= east logged and probably even throw. 1 we can fix now: just change the return value, 2 probably needs a follow u= p Jira as it is more complex. > Fair scheduler: queue deletion without RM restart > ------------------------------------------------- > > Key: YARN-8191 > URL: https://issues.apache.org/jira/browse/YARN-8191 > Project: Hadoop YARN > Issue Type: Improvement > Components: fairscheduler > Affects Versions: 3.0.1 > Reporter: Gergo Repas > Assignee: Gergo Repas > Priority: Major > Attachments: Queue Deletion in Fair Scheduler.pdf, YARN-8191.000.= patch, YARN-8191.001.patch, YARN-8191.002.patch, YARN-8191.003.patch, YARN-= 8191.004.patch, YARN-8191.005.patch, YARN-8191.006.patch, YARN-8191.007.pat= ch, YARN-8191.008.patch, YARN-8191.009.patch, YARN-8191.010.patch > > > The Fair Scheduler never cleans up queues even if they are deleted in the= allocation file, or were dynamically created and are never going to be use= d again. Queues always remain in memory which leads to two following issues= . > # Steady fairshares aren=E2=80=99t calculated correctly due to remaining= queues > # WebUI shows deleted queues, which is confusing for users (YARN-4022). > We want to support proper queue deletion without restarting the Resource = Manager: > # Static queues without any entries that are removed from fair-scheduler= .xml should be deleted from memory. > # Dynamic queues without any entries should be deleted. > # RM Web UI should only show the queues defined in the scheduler at that= point in time. -- This message was sent by Atlassian JIRA (v7.6.3#76005) --------------------------------------------------------------------- To unsubscribe, e-mail: yarn-issues-unsubscribe@hadoop.apache.org For additional commands, e-mail: yarn-issues-help@hadoop.apache.org