Return-Path: X-Original-To: archive-asf-public-internal@cust-asf2.ponee.io Delivered-To: archive-asf-public-internal@cust-asf2.ponee.io Received: from cust-asf.ponee.io (cust-asf.ponee.io [163.172.22.183]) by cust-asf2.ponee.io (Postfix) with ESMTP id A8722200BB6 for ; Thu, 20 Oct 2016 21:16:01 +0200 (CEST) Received: by cust-asf.ponee.io (Postfix) id A73E6160AE0; Thu, 20 Oct 2016 19:16:01 +0000 (UTC) Delivered-To: archive-asf-public@cust-asf.ponee.io Received: from mail.apache.org (hermes.apache.org [140.211.11.3]) by cust-asf.ponee.io (Postfix) with SMTP id 09F49160ACC for ; Thu, 20 Oct 2016 21:16:00 +0200 (CEST) Received: (qmail 80660 invoked by uid 500); 20 Oct 2016 19:16:00 -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 80633 invoked by uid 99); 20 Oct 2016 19:16:00 -0000 Received: from arcas.apache.org (HELO arcas) (140.211.11.28) by apache.org (qpsmtpd/0.29) with ESMTP; Thu, 20 Oct 2016 19:16:00 +0000 Received: from arcas.apache.org (localhost [127.0.0.1]) by arcas (Postfix) with ESMTP id EED262C0D52 for ; Thu, 20 Oct 2016 19:15:59 +0000 (UTC) Date: Thu, 20 Oct 2016 19:15:59 +0000 (UTC) From: "Vrushali C (JIRA)" To: yarn-issues@hadoop.apache.org Message-ID: In-Reply-To: References: Subject: [jira] [Updated] (YARN-5686) DefaultContainerExecutor random working dir algorigthm skews results MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: quoted-printable X-JIRA-FingerPrint: 30527f35849b9dde25b450d4833f0394 archived-at: Thu, 20 Oct 2016 19:16:01 -0000 [ https://issues.apache.org/jira/browse/YARN-5686?page=3Dcom.atlassian= .jira.plugin.system.issuetabpanels:all-tabpanel ] Vrushali C updated YARN-5686: ----------------------------- Attachment: YARN-5686.002.patch Uploading patch 002 that reorders the test case data and fixes the checksty= le comment. > DefaultContainerExecutor random working dir algorigthm skews results > -------------------------------------------------------------------- > > Key: YARN-5686 > URL: https://issues.apache.org/jira/browse/YARN-5686 > Project: Hadoop YARN > Issue Type: Bug > Reporter: Miklos Szegedi > Assignee: Vrushali C > Priority: Minor > Attachments: YARN-5686.001.patch, YARN-5686.002.patch > > > {code} > long randomPosition =3D RandomUtils.nextLong() % totalAvailable; > =E2=80=82=E2=80=82=E2=80=82=E2=80=82... > =E2=80=82=E2=80=82=E2=80=82=E2=80=82while (randomPosition > availableOnDi= sk[dir]) { > =E2=80=82=E2=80=82=E2=80=82=E2=80=82=E2=80=82=E2=80=82randomPosition -=3D= availableOnDisk[dir++]; > =E2=80=82=E2=80=82=E2=80=82=E2=80=82} > {code} > The code above selects a disk based on the random number weighted by the = free space on each disk respectively. For example, if I have two disks with= 100 bytes each, totalAvailable is 200. The value of randomPosition will be= 0..199. 0..99 should select the first disk, 100..199 should select the sec= ond disk inclusively. Random number 100 should select the second disk to be= fair but this is not the case right now. > We need to use=20 > {code} > while (randomPosition >=3D availableOnDisk[dir]) > {code} > instead of > {code} > while (randomPosition > availableOnDisk[dir]) > {code} -- This message was sent by Atlassian JIRA (v6.3.4#6332) --------------------------------------------------------------------- To unsubscribe, e-mail: yarn-issues-unsubscribe@hadoop.apache.org For additional commands, e-mail: yarn-issues-help@hadoop.apache.org