Return-Path: X-Original-To: apmail-hbase-user-archive@www.apache.org Delivered-To: apmail-hbase-user-archive@www.apache.org Received: from mail.apache.org (hermes.apache.org [140.211.11.3]) by minotaur.apache.org (Postfix) with SMTP id B6D6EC066 for ; Tue, 10 Jul 2012 17:23:26 +0000 (UTC) Received: (qmail 13276 invoked by uid 500); 10 Jul 2012 17:23:24 -0000 Delivered-To: apmail-hbase-user-archive@hbase.apache.org Received: (qmail 13147 invoked by uid 500); 10 Jul 2012 17:23:24 -0000 Mailing-List: contact user-help@hbase.apache.org; run by ezmlm Precedence: bulk List-Help: List-Unsubscribe: List-Post: List-Id: Reply-To: user@hbase.apache.org Delivered-To: mailing list user@hbase.apache.org Received: (qmail 13139 invoked by uid 99); 10 Jul 2012 17:23:24 -0000 Received: from athena.apache.org (HELO athena.apache.org) (140.211.11.136) by apache.org (qpsmtpd/0.29) with ESMTP; Tue, 10 Jul 2012 17:23:24 +0000 X-ASF-Spam-Status: No, hits=-0.7 required=5.0 tests=FSL_RCVD_USER,RCVD_IN_DNSWL_LOW,SPF_PASS X-Spam-Check-By: apache.org Received-SPF: pass (athena.apache.org: domain of svarma.ng@gmail.com designates 209.85.214.41 as permitted sender) Received: from [209.85.214.41] (HELO mail-bk0-f41.google.com) (209.85.214.41) by apache.org (qpsmtpd/0.29) with ESMTP; Tue, 10 Jul 2012 17:23:19 +0000 Received: by bkcjc3 with SMTP id jc3so278207bkc.14 for ; Tue, 10 Jul 2012 10:22:58 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20120113; h=mime-version:in-reply-to:references:date:message-id:subject:from:to :content-type; bh=Saz/PlvEEGwfDhfkKjAIfIiOgknTcO46hMb9mGX39pQ=; b=fFKCOoUkQmjM/zymfEUvGNQaHvS1fO6lcFXfo4W7qu9EhH46QXTG9qhXoMKaQw5vLP lPctt9gSeo6TzmmnF9R3qyMogEu2G2fUn/I5MT/huJm2glcJguZM4OGmSdj/sMGa06z+ mrZouShbr+4mmBl05sktD/VW3cERpyu4xSdhxB+69SneFFBm3+trJjBlDZ8SJV/rXYN1 RRV/b9lTXzecb7zhFQ0XzV0SE1aTJ57NLA3M7s+7oa4JnKXL9QKI5RzTVAyYL1W2qoui d8IA3yNohHhl+zNDq8dHUgR+12cB4d1Rr+RQ/Gv/Ldls9lEkhoZpBP16B0DBvAG97vTK qanA== MIME-Version: 1.0 Received: by 10.205.130.17 with SMTP id hk17mr22998751bkc.76.1341940978490; Tue, 10 Jul 2012 10:22:58 -0700 (PDT) Received: by 10.204.124.6 with HTTP; Tue, 10 Jul 2012 10:22:58 -0700 (PDT) In-Reply-To: References: Date: Tue, 10 Jul 2012 10:22:58 -0700 Message-ID: Subject: Re: HBaseClient recovery from .META. server power down From: Suraj Varma To: user@hbase.apache.org Content-Type: text/plain; charset=ISO-8859-1 X-Virus-Checked: Checked by ClamAV on apache.org Yes. On the maxRetries, though ... I saw the code (http://grepcode.com/file/repo1.maven.org/maven2/org.apache.hbase/hbase/0.90.2/org/apache/hadoop/hbase/ipc/HBaseClient.java#677) show this.maxRetries = conf.getInt("hbase.ipc.client.connect.max.retries", 0); So - looks like by default, the maxRetries is set to 0? So ... there is effectively no retry (i.e. it is fail-fast) --Suraj On Tue, Jul 10, 2012 at 10:12 AM, N Keywal wrote: > Thanks for the jira. > The client can be connected to multiple RS, depending on the rows is > working on. So yes it's initial, but it's a dynamic initial :-). > This said there is a retry on error... > > On Tue, Jul 10, 2012 at 6:46 PM, Suraj Varma wrote: >> I will create a JIRA ticket ... >> >> The only side-effect I could think of is ... if a RS is having a GC of >> a few seconds, any _new_ client trying to connect would get connect >> failures. So ... the _initial_ connection to the RS is what would >> suffer from a super-low setting of the ipc.socket.timeout. This was my >> read of the code. >> >> So - was hoping to get a confirmation if this is the only side effect. >> Again - this is on the client side - I wouldn't risk doing this on the >> cluster side ... >> --Suraj >> >> On Mon, Jul 9, 2012 at 9:44 AM, N Keywal wrote: >>> Hi, >>> >>> What you're describing -the 35 minutes recovery time- seems to match >>> the code. And it's a bug (still there on trunk). Could you please >>> create a jira for it? If you have the logs it even better. >>> >>> Lowering the ipc.socket.timeout seems to be an acceptable partial >>> workaround. Setting it to 10s seems ok to me. Lower than this... I >>> don't know. >>> >>> N. >>> >>> >>> On Mon, Jul 9, 2012 at 6:16 PM, Suraj Varma wrote: >>>> Hello: >>>> I'd like to get advice on the below strategy of decreasing the >>>> "ipc.socket.timeout" configuration on the HBase Client side ... has >>>> anyone tried this? Has anyone had any issues with configuring this >>>> lower than the default 20s? >>>> >>>> Thanks, >>>> --Suraj >>>> >>>> On Mon, Jul 2, 2012 at 5:51 PM, Suraj Varma wrote: >>>>> By "power down" below, I mean powering down the host with the RS that >>>>> holds the .META. table. (So - essentially, the host IP is unreachable >>>>> and the RS/DN is gone.) >>>>> >>>>> Just wanted to clarify my below steps ... >>>>> --S >>>>> >>>>> On Mon, Jul 2, 2012 at 5:36 PM, Suraj Varma wrote: >>>>>> Hello: >>>>>> We've been doing some failure scenario tests by powering down a .META. >>>>>> holding region server host and while the HBase cluster itself recovers >>>>>> and reassigns the META region and other regions (after we tweaked down >>>>>> the default timeouts), our client apps using HBaseClient take a long >>>>>> time to recover. >>>>>> >>>>>> hbase-0.90.6 / cdh3u4 / JDK 1.6.0_23 >>>>>> >>>>>> Process: >>>>>> 1) Apply load via client app on HBase cluster for several minutes >>>>>> 2) Power down the region server holding the .META. server >>>>>> 3) Measure how long it takes for cluster to reassign META table and >>>>>> for client threads to re-lookup and re-orient to the lesser cluster >>>>>> (minus the RS and DN on that host). >>>>>> >>>>>> What we see: >>>>>> 1) Client threads spike up to maxThread size ... and take over 35 mins >>>>>> to recover (i.e. for the thread count to go back to normal) - no calls >>>>>> are being serviced - they are all just backed up on a synchronized >>>>>> method ... >>>>>> >>>>>> 2) Essentially, all the client app threads queue up behind the >>>>>> HBaseClient.setupIOStreams method in oahh.ipc.HBaseClient >>>>>> (http://grepcode.com/file/repo1.maven.org/maven2/org.apache.hbase/hbase/0.90.2/org/apache/hadoop/hbase/ipc/HBaseClient.java#312). >>>>>> http://tinyurl.com/7js53dj >>>>>> >>>>>> After taking several thread dumps we found that the thread within this >>>>>> synchronized method was blocked on >>>>>> NetUtils.connect(this.socket, remoteId.getAddress(), getSocketTimeout(conf)); >>>>>> >>>>>> Essentially, the thread which got the lock would try to connect to the >>>>>> dead RS (till socket times out), retrying, and then the next thread >>>>>> gets in and so forth. >>>>>> >>>>>> Solution tested: >>>>>> ------------------- >>>>>> So - the ipc.HBaseClient code shows ipc.socket.timeout default is 20s. >>>>>> We dropped this down to a low number (1000 ms, 100 ms, etc) and the >>>>>> recovery was much faster (in a couple of minutes). >>>>>> >>>>>> So - we're thinking of setting the HBase client side hbase-site.xml >>>>>> with an ipc.socket.timeout of 100ms. Looking at the code, it appears >>>>>> that this is only ever used during the initial "HConnection" setup via >>>>>> the NetUtils.connect and should only ever be used when connectivity to >>>>>> a region server is lost and needs to be re-established. i.e it does >>>>>> not affect the normal "RPC" actiivity as this is just the connect >>>>>> timeout. >>>>>> >>>>>> Am I reading the code right? Any thoughts on how whether this is too >>>>>> low for comfort? (Our internal tests did not show any errors during >>>>>> normal operation related to timeouts etc ... but, I just wanted to run >>>>>> this by the experts.). >>>>>> >>>>>> Note that this above timeout tweak is only on the HBase client side. >>>>>> Thanks, >>>>>> --Suraj