From issues-return-48824-archive-asf-public=cust-asf.ponee.io@mesos.apache.org Wed Sep 12 23:29:04 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 767E1180630 for ; Wed, 12 Sep 2018 23:29:03 +0200 (CEST) Received: (qmail 80694 invoked by uid 500); 12 Sep 2018 21:29:02 -0000 Mailing-List: contact issues-help@mesos.apache.org; run by ezmlm Precedence: bulk List-Help: List-Unsubscribe: List-Post: List-Id: Reply-To: dev@mesos.apache.org Delivered-To: mailing list issues@mesos.apache.org Received: (qmail 80685 invoked by uid 99); 12 Sep 2018 21:29:02 -0000 Received: from pnap-us-west-generic-nat.apache.org (HELO spamd2-us-west.apache.org) (209.188.14.142) by apache.org (qpsmtpd/0.29) with ESMTP; Wed, 12 Sep 2018 21:29:02 +0000 Received: from localhost (localhost [127.0.0.1]) by spamd2-us-west.apache.org (ASF Mail Server at spamd2-us-west.apache.org) with ESMTP id 237A31A16C5 for ; Wed, 12 Sep 2018 21:29:02 +0000 (UTC) X-Virus-Scanned: Debian amavisd-new at spamd2-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-us.apache.org ([10.40.0.8]) by localhost (spamd2-us-west.apache.org [10.40.0.9]) (amavisd-new, port 10024) with ESMTP id HrmxrecoseTq for ; Wed, 12 Sep 2018 21:29:01 +0000 (UTC) Received: from mailrelay1-us-west.apache.org (mailrelay1-us-west.apache.org [209.188.14.139]) by mx1-lw-us.apache.org (ASF Mail Server at mx1-lw-us.apache.org) with ESMTP id D33F65F52A for ; Wed, 12 Sep 2018 21:29:00 +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 4C8AFE070F for ; Wed, 12 Sep 2018 21:29: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 1209E2468F for ; Wed, 12 Sep 2018 21:29:00 +0000 (UTC) Date: Wed, 12 Sep 2018 21:29:00 +0000 (UTC) From: "Benjamin Bannier (JIRA)" To: issues@mesos.apache.org Message-ID: In-Reply-To: References: Subject: [jira] [Comment Edited] (MESOS-9227) `Value::Scalar` cannot handle large floating point calculation due to fixed point conversion. 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/MESOS-9227?page=3Dcom.atlassian= .jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=3D1661= 2634#comment-16612634 ]=20 Benjamin Bannier edited comment on MESOS-9227 at 9/12/18 9:28 PM: ------------------------------------------------------------------ I believe to some degree the way our fixed point math truncates away small = fractions has prevented exactness issues for smaller values. Since scalar resource values are stored as {{double}} internally in the {{R= esource}} message, they can only hold around 15 significant digits. We want= to guarantee correct fixed point math with up to three decimal places, so = we can represent values exactly up to around 10=C2=B9=C2=B2 kB =3D 0.1 PB. Such an amount of {{disk}} is unfortunately not unrealistic even for a sing= le agent where we might already run into correctness issues, but it should = be possible to e.g., warn users that agent resources might not be represent= able. The issue is worse if the total capacity of {{disk}} in the cluster r= eaches petabyte scale (either with some agents with huge, but representable= disks, or many agents with considerable disks). The sum of {{disk}} might = be not representable in the master, but would be below the obviously proble= matic threshold for each agent, making it harder to diagnose such issues. A possible short term mitigation might be to store disk resources in GB ins= tead of kB which would by us a couple magnitudes at the cost of being unabl= e to represent values less than around 1 MB. was (Author: bbannier): I believe to some degree the way our fixed point math truncates away small = fractions has prevented exactness issues for smaller values. Since scalar resource values are stored as {{double}} internally in the {{R= esource}} message, they can only hold around 15 significant digits. We want= to guarantee correct fixed point math with up to three decimal places, so = we can represent values exactly up to around 10=C2=B9=C2=B9 kB =3D 0.1 PB. Such an amount of {{disk}} is unfortunately not unrealistic even for a sing= le agent where we might already run into correctness issues, but it should = be possible to e.g., warn users that agent resources might not be represent= able. The issue is worse if the total capacity of {{disk}} in the cluster r= eaches petabyte scale (either with some agents with huge, but representable= disks, or many agents with considerable disks). The sum of {{disk}} might = be not representable in the master, but would be below the obviously proble= matic threshold for each agent, making it harder to diagnose such issues. A possible short term mitigation might be to store disk resources in GB ins= tead of kB which would by us a couple magnitudes at the cost of being unabl= e to represent values less than around 1 MB. > `Value::Scalar` cannot handle large floating point calculation due to fix= ed point conversion. > -------------------------------------------------------------------------= -------------------- > > Key: MESOS-9227 > URL: https://issues.apache.org/jira/browse/MESOS-9227 > Project: Mesos > Issue Type: Bug > Reporter: Meng Zhu > Priority: Blocker > > While `scalar` holds a `double`, internally we convert floating point to = fixed point to ensure only three decimal digits: > https://github.com/apache/mesos/blob/851ec9c5dca672ed4efc77545c8612146369= 5e4f/src/common/values.cpp#L48-L53 > And all internal arithmetic calculations are done using `long long`, e.g.= : > https://github.com/apache/mesos/blob/851ec9c5dca672ed4efc77545c8612146369= 5e4f/src/common/values.cpp#L123-L128 > This has the unexpected consequence of the inability to handle large valu= es. One impacted use case we are seeing is with exabytes of disks. This wil= l overflow the fixed point representation. -- This message was sent by Atlassian JIRA (v7.6.3#76005)