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 7D043200D61 for ; Tue, 14 Nov 2017 04:06:22 +0100 (CET) Received: by cust-asf.ponee.io (Postfix) id 7B744160BF3; Tue, 14 Nov 2017 03:06:22 +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 9B5FF160C06 for ; Tue, 14 Nov 2017 04:06:21 +0100 (CET) Received: (qmail 52859 invoked by uid 500); 14 Nov 2017 03:06:20 -0000 Mailing-List: contact dev-help@hawq.incubator.apache.org; run by ezmlm Precedence: bulk List-Help: List-Unsubscribe: List-Post: List-Id: Reply-To: dev@hawq.incubator.apache.org Delivered-To: mailing list dev@hawq.incubator.apache.org Received: (qmail 52830 invoked by uid 99); 14 Nov 2017 03:06:19 -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; Tue, 14 Nov 2017 03:06:19 +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 77EC81A11C0 for ; Tue, 14 Nov 2017 03:06:18 +0000 (UTC) X-Virus-Scanned: Debian amavisd-new at spamd2-us-west.apache.org X-Spam-Flag: NO X-Spam-Score: 2.731 X-Spam-Level: ** X-Spam-Status: No, score=2.731 tagged_above=-999 required=6.31 tests=[DKIM_SIGNED=0.1, DKIM_VALID=-0.1, HTML_MESSAGE=2, KAM_INFOUSMEBIZ=0.75, RCVD_IN_DNSWL_NONE=-0.0001, RCVD_IN_MSPIKE_H3=-0.01, RCVD_IN_MSPIKE_WL=-0.01, URIBL_BLOCKED=0.001] autolearn=disabled Authentication-Results: spamd2-us-west.apache.org (amavisd-new); dkim=pass (2048-bit key) header.d=pivotal-io.20150623.gappssmtp.com 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 w_jLj6eOXkvf for ; Tue, 14 Nov 2017 03:06:15 +0000 (UTC) Received: from mail-ua0-f173.google.com (mail-ua0-f173.google.com [209.85.217.173]) by mx1-lw-us.apache.org (ASF Mail Server at mx1-lw-us.apache.org) with ESMTPS id 6F5B25FD14 for ; Tue, 14 Nov 2017 03:06:15 +0000 (UTC) Received: by mail-ua0-f173.google.com with SMTP id v27so12897684uav.7 for ; Mon, 13 Nov 2017 19:06:15 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=pivotal-io.20150623.gappssmtp.com; s=20150623; h=mime-version:in-reply-to:references:from:date:message-id:subject:to; bh=oRXCSsLjWeOIZc2YYuO/bkTvEiss1Lf5QYnPrCyyjR0=; b=QFWGTCAh/KUtvy1COaiWRqAf1cbAWoL9JotkDKyeCdkYF+do1jvXT3hxIsPNMfJonX k5TjfTLYeoVs+zr6ZzSrQmBNbZchi68Zd2UBZZajmvhN2bhEHAFHr1RifMEhSPGoUrX8 5OXbkghDBBf15Is9lbJHzgSwL6DuShZ+nsVFzYgtYWExHf4yPNHEhNgsO42WtZq+q6L6 AJs7XkdcFOsxndaPU+87sm46Pgj2QtZrzfL8sYagywbV5nQlkL//JAknqJkB4Pq4zXGU xFyvZzgum/A32+yngH8RMVB62SfNNK+VUxTYXnOPr/4PDRdXd2v8eEketBR24gMFNPx0 7iZQ== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:mime-version:in-reply-to:references:from:date :message-id:subject:to; bh=oRXCSsLjWeOIZc2YYuO/bkTvEiss1Lf5QYnPrCyyjR0=; b=qVYh6Xz91VGUwqAqbEuem8zT2bYeM+HQpGQIEiQeUIXY/EECVjWW5ghD3SHCtApa57 /g3WAGvvo7l9dSCguUu5tqLkpwxxEKacKEFp0ilSjNtVpILtIU9nVyMSfp5xsaI7HRVa SZTDZ2W7/fgNYNj01H6/Ls+YZ6nPP/MYEUJpit+1tEvpNIXMFlHtuAbfeC4r5cGrMaqU sgHQkFmy9l5DFs+t1y5xLswtQJIViDnpmyNGHT2wPvoe2r/EFG9NIM95TapdjNUi0T11 QU8hu04193t57DbxVfzNtDpSoL1qwK+JLWnAgqJqWk34UoH8zgIJnsQ+bzYkHFOot0sr 0Ipg== X-Gm-Message-State: AJaThX5RPsfnKekN17ffdnjjSaPKCrxufifSkor3m7FdaA992Mr2RRNm KDDpzbVDF0FaIlhWDHoBccZTuhdZ5+yhx/xRIWM86DNV X-Google-Smtp-Source: AGs4zMYji4zRMVt65AgXzYaveJyAzQeqnNs7J8H8QdTlc9HMewRbMCPqjvr7BSJfyLqrSMfxk3CQVDj7q30FLUWecbs= X-Received: by 10.176.92.28 with SMTP id q28mr9866723uaf.48.1510628768636; Mon, 13 Nov 2017 19:06:08 -0800 (PST) MIME-Version: 1.0 Received: by 10.31.188.9 with HTTP; Mon, 13 Nov 2017 19:06:08 -0800 (PST) In-Reply-To: References: From: Shubham Sharma Date: Mon, 13 Nov 2017 19:06:08 -0800 Message-ID: Subject: Re: Hawq standby sync fails if there are existing connections to master To: dev@hawq.incubator.apache.org Content-Type: multipart/alternative; boundary="f40304361532247a1e055de8abb3" archived-at: Tue, 14 Nov 2017 03:06:22 -0000 --f40304361532247a1e055de8abb3 Content-Type: text/plain; charset="UTF-8" Content-Transfer-Encoding: quoted-printable Thanks Radar, fixed this under PR - https://github.com/apache/incubator-hawq/pull/1311 On Mon, Nov 13, 2017 at 6:32 PM, Radar Lei wrote: > Hi Shubham, > > The behavior is intentional but use '-M' option to force it should be goo= d. > Thanks. > > Regards, > Radar > > On Tue, Nov 14, 2017 at 10:05 AM, Shubham Sharma > wrote: > > > To close this thread, the source of this issue appears to be > > tools/bin/hawq_ctl method _resync_standby. When this is called the > command > > formation does not include stop_mode options as passed to the arguments= . > > > > def _resync_standby(self): > > logger.info("Re-sync standby") > > cmd =3D "%s; hawq stop master -a;" % source_hawq_env > > check_return_code(local_ssh(cmd, logger), logger, "Stop hawq > > cluster failed, exit") > > ...... > > ...... > > > > JIRA ID - HAWQ-1549 > > > > On Mon, Nov 13, 2017 at 5:56 PM, Shubham Sharma > > wrote: > > > > > Thanks, I think I found out where the issue is. Will create a JIRA an= d > > > submit PR. > > > > > > On Mon, Nov 13, 2017 at 5:54 PM, Lei Chang > > wrote: > > > > > >> oh, yes, make sense, I overlooked the -M option here. > > >> > > >> Here we should respect the input "-M" option. > > >> > > >> Cheers > > >> Lei > > >> > > >> > > >> > > >> On Tue, Nov 14, 2017 at 8:46 AM, Shubham Sharma > > >> wrote: > > >> > > >> > Thanks for the response Lei. > > >> > > > >> > I understand this completely and agree with the behavior that we > > should > > >> not > > >> > brutally terminate connections. > > >> > > > >> > However, the case here is, am deliberately trying to use stop mode > > using > > >> > command `hawq init standby -n -v -M fast`. At this point as a user= I > > >> > understand that connections will be terminated without warning. Wh= en > > >> > passing option `-M fast` hawq should not interrupt me. > > >> > > > >> > Basically, hawq command line is not respecting `-M fast`. Whereas > hawq > > >> init > > >> > standby --help documents this option. Let me know if this makes > sense. > > >> > > > >> > > > >> > hawq init standby --help > > >> > > > >> > Usage: HAWQ management scripts options > > >> > > > >> > > > >> > Options: > > >> > > > >> > -h, --help show this help message and exit > > >> > > > >> > -a, --prompt Execute automatically > > >> > > > >> > -M STOP_MODE, --mode=3DSTOP_MODE > > >> > > > >> > HAWQ stop mode: smart/fast/immediate > > >> > > > >> > > > >> > On Mon, Nov 13, 2017 at 4:32 PM, Lei Chang > > >> wrote: > > >> > > > >> > > Hi Shubham, > > >> > > > > >> > > The behavior is intentional. If there are connections when HAWQ > init > > >> > > standby, it is better to warn the client instead of cutting the > > >> > connections > > >> > > brutally. > > >> > > > > >> > > Cheers > > >> > > Lei > > >> > > > > >> > > > > >> > > > > >> > > On Mon, Nov 13, 2017 at 11:58 AM, Shubham Sharma < > > ssharma@pivotal.io> > > >> > > wrote: > > >> > > > > >> > > > Hello folks, > > >> > > > > > >> > > > Recently observed a behaviour while re-syncing standby from ha= wq > > >> > command > > >> > > > line. > > >> > > > > > >> > > > Here are the reproduction steps - > > >> > > > > > >> > > > 1 - Open a client connection to hawq using psql > > >> > > > 2 - From a different terminal run command - hawq init standby = -n > > -v > > >> -M > > >> > > fast > > >> > > > 3 - Standby resync fails with error > > >> > > > > > >> > > > > > >> > > > 20171113:03:49:21:158354 hawq_stop:hdp3:gpadmin-[ > WARNING]:-There > > >> are > > >> > > > other connections to this instance, shutdown mode smart aborte= d > > >> > > > > > >> > > > 20171113:03:49:21:158354 hawq_stop:hdp3:gpadmin-[ > WARNING]:-Either > > >> > > > remove connections, or use 'hawq stop master -M fast' or 'hawq > > stop > > >> > > > master -M immediate' > > >> > > > > > >> > > > 20171113:03:49:21:158354 hawq_stop:hdp3:gpadmin-[WARNING]:-See > > hawq > > >> > > > stop --help for all options > > >> > > > > > >> > > > 20171113:03:49:21:158354 hawq_stop:hdp3:gpadmin-[ERROR]:-Activ= e > > >> > > > connections. Aborting shutdown... > > >> > > > > > >> > > > 20171113:03:49:21:158143 hawq_init:hdp3:gpadmin-[ERROR]:-Stop > > hawq > > >> > > > cluster failed, exit > > >> > > > > > >> > > > 4 - My understanding is when -M (stop mode) is passed it shoul= d > > >> > terminate > > >> > > > existing client connections. Also, it seems like a good practi= ce > > to > > >> > > > terminate client connections before standby master resync. > > >> > > > > > >> > > > Is this an expected behavior in hawq ? If not, I can open a JI= RA > > and > > >> > work > > >> > > > on a pull request to fix this. > > >> > > > > > >> > > > Looking forward to your thoughts on this. > > >> > > > =E2=80=8B > > >> > > > -- > > >> > > > Regards, > > >> > > > Shubham Sharma > > >> > > > > > >> > > > > >> > > > >> > > > >> > > > >> > -- > > >> > Regards, > > >> > Shubham Sharma > > >> > Staff Customer Engineer > > >> > Pivotal Global Support Services > > >> > ssharma@pivotal.io > > >> > Direct Tel: +1(510)-304-8201 > > >> > Office Hours: Mon-Fri 9:00 am to 5:00 pm PDT > > >> > Out of Office Hours Contact +1 877-477-2269 > > >> > > > >> > > > > > > > > > > > > -- > > > Regards, > > > Shubham Sharma > > > Staff Customer Engineer > > > Pivotal Global Support Services > > > ssharma@pivotal.io > > > Direct Tel: +1(510)-304-8201 <(510)%20304-8201> > > > Office Hours: Mon-Fri 9:00 am to 5:00 pm PDT > > > Out of Office Hours Contact +1 877-477-2269 <(877)%20477-2269> > > > > > > > > > > > -- > > Regards, > > Shubham Sharma > > Staff Customer Engineer > > Pivotal Global Support Services > > ssharma@pivotal.io > > Direct Tel: +1(510)-304-8201 > > Office Hours: Mon-Fri 9:00 am to 5:00 pm PDT > > Out of Office Hours Contact +1 877-477-2269 > > > --=20 Regards, Shubham Sharma Staff Customer Engineer Pivotal Global Support Services ssharma@pivotal.io Direct Tel: +1(510)-304-8201 Office Hours: Mon-Fri 9:00 am to 5:00 pm PDT Out of Office Hours Contact +1 877-477-2269 --f40304361532247a1e055de8abb3--