From dev-return-48862-archive-asf-public=cust-asf.ponee.io@phoenix.apache.org Fri Jan 26 21:52:05 2018 Return-Path: X-Original-To: archive-asf-public@eu.ponee.io Delivered-To: archive-asf-public@eu.ponee.io Received: from cust-asf.ponee.io (cust-asf.ponee.io [163.172.22.183]) by mx-eu-01.ponee.io (Postfix) with ESMTP id 80D9F180676 for ; Fri, 26 Jan 2018 21:52:05 +0100 (CET) Received: by cust-asf.ponee.io (Postfix) id 6C63F160C50; Fri, 26 Jan 2018 20:52:05 +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 B417D160C3E for ; Fri, 26 Jan 2018 21:52:04 +0100 (CET) Received: (qmail 38672 invoked by uid 500); 26 Jan 2018 20:52:03 -0000 Mailing-List: contact dev-help@phoenix.apache.org; run by ezmlm Precedence: bulk List-Help: List-Unsubscribe: List-Post: List-Id: Reply-To: dev@phoenix.apache.org Delivered-To: mailing list dev@phoenix.apache.org Received: (qmail 38580 invoked by uid 99); 26 Jan 2018 20:52:03 -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; Fri, 26 Jan 2018 20:52:03 +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 382351A1561 for ; Fri, 26 Jan 2018 20:52:03 +0000 (UTC) X-Virus-Scanned: Debian amavisd-new at spamd2-us-west.apache.org X-Spam-Flag: NO X-Spam-Score: -101.511 X-Spam-Level: X-Spam-Status: No, score=-101.511 tagged_above=-999 required=6.31 tests=[KAM_ASCII_DIVIDERS=0.8, RCVD_IN_DNSWL_MED=-2.3, SPF_PASS=-0.001, T_RP_MATCHES_RCVD=-0.01, 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 06qfSCUZ9Ol1 for ; Fri, 26 Jan 2018 20:52:02 +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 CCC9060D3D for ; Fri, 26 Jan 2018 20:52: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 19244E00A5 for ; Fri, 26 Jan 2018 20:52:01 +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 46F452410E for ; Fri, 26 Jan 2018 20:52:00 +0000 (UTC) Date: Fri, 26 Jan 2018 20:52:00 +0000 (UTC) From: "ASF GitHub Bot (JIRA)" To: dev@phoenix.apache.org Message-ID: In-Reply-To: References: Subject: [jira] [Commented] (PHOENIX-4130) Avoid server retries for mutable indexes MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 7bit X-JIRA-FingerPrint: 30527f35849b9dde25b450d4833f0394 [ https://issues.apache.org/jira/browse/PHOENIX-4130?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=16341578#comment-16341578 ] ASF GitHub Bot commented on PHOENIX-4130: ----------------------------------------- Github user JamesRTaylor commented on a diff in the pull request: https://github.com/apache/phoenix/pull/290#discussion_r164218981 --- Diff: phoenix-core/src/main/java/org/apache/phoenix/optimize/QueryOptimizer.java --- @@ -312,6 +317,16 @@ private static QueryPlan addPlan(PhoenixStatement statement, SelectStatement sel return null; } + // returns true if we can still use the index + // retuns false if we've been in PENDING_DISABLE too long - index should be considered disabled + private static boolean isUnderPendingDisableThreshold(PhoenixStatement statement, PTable indexTable) { + return EnvironmentEdgeManager + .currentTimeMillis() - indexTable.getIndexDisableTimestamp() <= statement --- End diff -- Sounds fine > Avoid server retries for mutable indexes > ---------------------------------------- > > Key: PHOENIX-4130 > URL: https://issues.apache.org/jira/browse/PHOENIX-4130 > Project: Phoenix > Issue Type: Improvement > Reporter: Lars Hofhansl > Assignee: Vincent Poon > Priority: Major > Fix For: 4.14.0 > > Attachments: PHOENIX-4130.v1.master.patch, PHOENIX-4130.v2.master.patch, PHOENIX-4130.v3.master.patch > > > Had some discussions with [~jamestaylor], [~samarthjain], and [~vincentpoon], during which I suggested that we can possibly eliminate retry loops happening at the server that cause the handler threads to be stuck potentially for quite a while (at least multiple seconds to ride over common scenarios like splits). > Instead we can do the retries at the Phoenix client that. > So: > # The index updates are not retried on the server. (retries = 0) > # A failed index update would set the failed index timestamp but leave the index enabled. > # Now the handler thread is done, it throws an appropriate exception back to the client. > # The Phoenix client can now retry. When those retries fail the index is disabled (if the policy dictates that) and throw the exception back to its caller. > So no more waiting is needed on the server, handler threads are freed immediately. -- This message was sent by Atlassian JIRA (v7.6.3#76005)