From dev-return-2092-apmail-tephra-dev-archive=tephra.apache.org@tephra.incubator.apache.org Mon Apr 2 22:42:03 2018 Return-Path: X-Original-To: apmail-tephra-dev-archive@minotaur.apache.org Delivered-To: apmail-tephra-dev-archive@minotaur.apache.org Received: from mail.apache.org (hermes.apache.org [140.211.11.3]) by minotaur.apache.org (Postfix) with SMTP id D2341180A9 for ; Mon, 2 Apr 2018 22:42:03 +0000 (UTC) Received: (qmail 59769 invoked by uid 500); 2 Apr 2018 22:42:03 -0000 Delivered-To: apmail-tephra-dev-archive@tephra.apache.org Received: (qmail 59723 invoked by uid 500); 2 Apr 2018 22:42:03 -0000 Mailing-List: contact dev-help@tephra.incubator.apache.org; run by ezmlm Precedence: bulk List-Help: List-Unsubscribe: List-Post: List-Id: Reply-To: dev@tephra.incubator.apache.org Delivered-To: mailing list dev@tephra.incubator.apache.org Received: (qmail 59712 invoked by uid 99); 2 Apr 2018 22:42:03 -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; Mon, 02 Apr 2018 22:42:03 +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 CA4B9C20C7 for ; Mon, 2 Apr 2018 22:42:02 +0000 (UTC) X-Virus-Scanned: Debian amavisd-new at spamd1-us-west.apache.org X-Spam-Flag: NO X-Spam-Score: -109.511 X-Spam-Level: X-Spam-Status: No, score=-109.511 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, T_RP_MATCHES_RCVD=-0.01, 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 feSXa4R44aFa for ; Mon, 2 Apr 2018 22:42:01 +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 042B75F4AA for ; Mon, 2 Apr 2018 22:42:01 +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 47309E00CA for ; Mon, 2 Apr 2018 22:42: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 0B00F2560D for ; Mon, 2 Apr 2018 22:42:00 +0000 (UTC) Date: Mon, 2 Apr 2018 22:42:00 +0000 (UTC) From: "Andreas Neumann (JIRA)" To: dev@tephra.incubator.apache.org Message-ID: In-Reply-To: References: Subject: [jira] [Commented] (TEPHRA-269) Protect the Transaction Manager against misconfigured clients using rate limits 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/TEPHRA-269?page=3Dcom.atlassian= .jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=3D1642= 3226#comment-16423226 ]=20 Andreas Neumann commented on TEPHRA-269: ---------------------------------------- Nice design! A couple of comments: * would it make sense to blacklist a misbehaving client, and require to ex= plicitly un-blacklist it before it can start transactions again? If you unt= hrottle it after its bucket is empty, it will just start misbehaving again.= =C2=A0 * if we have a way to generate a report, would it make sense to include ot= her metrics such as number or percentage of invalid transactions compared t= o all of its transactions? Th.at would help ops to identify systemically mi= sbehaving clients * An alternative to the=C2=A0_long nextStartTxnMillis(String clientId);_= =C2=A0could be _void startPermitted(clientId) throws RateLImitExceededExcep= tion_, and that exception can include the number of outstanding operations = as well as the required delay.=C2=A0 * In the LeakyBucket implementation, the nextOperationMillis state variabl= e appears unnecessary, as it is derived from outstandingOps. * When cleaning up the LeakyBuckets, I don't think the delta is required b= efore expiring an entry. Or why is it needed? * The getRateLimits() client API should return a Java object and not a Str= ing. Even if you use Json format to serialize this over the Thrift wire, th= at should not be exposed to the client.=C2=A0 > Protect the Transaction Manager against misconfigured clients using rate = limits > -------------------------------------------------------------------------= ------ > > Key: TEPHRA-269 > URL: https://issues.apache.org/jira/browse/TEPHRA-269 > Project: Tephra > Issue Type: New Feature > Components: core > Reporter: Poorna Chandra > Assignee: Poorna Chandra > Priority: Major > Fix For: 0.14.0-incubating > > Attachments: Ensure QoS in Transaction Manager by rate limiting c= lient requests.pdf > > > We have seen cases where misconfigured clients can overwhelm the system b= y making expensive requests (like invalidating transactions). By the time a= dmins figure out there is a misconfigured client and take corrective action= , thousands of invalid transactions can be created in a very short period o= f time. It would be useful to have a way to limit the number of invalid tra= nsactions that a client can create in given time. > I'll send out a design document for this soon. -- This message was sent by Atlassian JIRA (v7.6.3#76005)