Received: from malur.postgresql.org ([217.196.149.56]) by arkaria.postgresql.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_CBC_SHA1:256) (Exim 4.89) (envelope-from ) id 1hueu5-00089V-NI for pgsql-general@arkaria.postgresql.org; Mon, 05 Aug 2019 15:28:06 +0000 Received: from localhost ([127.0.0.1] helo=malur.postgresql.org) by malur.postgresql.org with esmtp (Exim 4.89) (envelope-from ) id 1hueu4-0006PU-DI for pgsql-general@arkaria.postgresql.org; Mon, 05 Aug 2019 15:28:04 +0000 Received: from makus.postgresql.org ([2001:4800:3e1:1::229]) by malur.postgresql.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_CBC_SHA1:256) (Exim 4.89) (envelope-from ) id 1hueu3-0006PN-J8 for pgsql-general@lists.postgresql.org; Mon, 05 Aug 2019 15:28:04 +0000 Received: from mail-oln040092010074.outbound.protection.outlook.com ([40.92.10.74] helo=NAM04-CO1-obe.outbound.protection.outlook.com) by makus.postgresql.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_CBC_SHA1:256) (Exim 4.92) (envelope-from ) id 1huetz-00079B-Sg for pgsql-general@postgresql.org; Mon, 05 Aug 2019 15:28:02 +0000 ARC-Seal: i=1; a=rsa-sha256; s=arcselector9901; d=microsoft.com; cv=none; b=MBjMcSYAzmKTABNmKDHKiFSFIMT7w6sLoVHTOJY7QqP8LnxdXL6oIu+bL2bkYPtGFjp6KRjcjLpImu2wKX+4Nnnpw4UyRe3AJLLVfGE5ynv0HtAj/ucbaUHFRYXsihr0h/BRocnvyE/eQ7y9ZotKYj4pLHdQa0NkYqgee/Q6GQ1yDA8g5trbhpNP0WdJbzNO3hCqn3oTth4UdszUIzNqlPa6FcQ/ld5GWHrfus+Zt7+qrTGCQ5MBNWngXurLSpNwFD1998PHqLZr/0fK+o8Q9ksVyr7YsJzpinREQEuN2bDi8ngRZHb0JMJcxBRKEDWjkQs6eECAH+TI57kGzo2PKw== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=microsoft.com; s=arcselector9901; h=From:Date:Subject:Message-ID:Content-Type:MIME-Version:X-MS-Exchange-SenderADCheck; bh=fbYNjQC+bvaXQIsCVB+3NpPmYDpvnkJuWkD+itB7vD8=; b=SnMAtwd3/Y6B+azkFjLeUNhMm0iAeLuDkc5FtCaznttq8U1QpzK9r7/GUQpos8ASSK/qGT9OYXpPFv8uAY1h1THdBhggRXB9WjBPHT8/2xAOEruCidwKLTcDK6yhImSO2+iLQr7i3hBfanD2gvjM8CbjzakHtjdjH+xCS8QBvw3rSjMj1aVyr89tGuH3c4hHMJVCYnYzIdyyiWm9/I8oOyWVN5VZk9GOk2xby9Oe3glSK6v0o+EAK5NMSJZgfFNDpjW6wPgQ5VZEJJfbrOzSCtteafrNMygGWROgQIeK1wo5wd4IYotOg2yyd3wg1uTK1446+1t00TXYhe/aEi7BZg== ARC-Authentication-Results: i=1; mx.microsoft.com 1;spf=none;dmarc=none;dkim=none;arc=none DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=hotmail.com; s=selector1; h=From:Date:Subject:Message-ID:Content-Type:MIME-Version:X-MS-Exchange-SenderADCheck; bh=fbYNjQC+bvaXQIsCVB+3NpPmYDpvnkJuWkD+itB7vD8=; b=PcfUFAf09X4Iu8Ayu2CLOOBkNH+0y/HsPRx6WXR6YWEC2QW3QEGqQuza/HQpWb7hZc3OX5mL+CMPjRMdlRLXvh8ER6jwZ93/449LTlXzMsB8Y+E5WmCXpbyWz/D6NvCd8VIO/SjrGqgVJ7Rlgj4saEkVRie5M7+KRZNZD2Y817jpValTHQrXNBAoq4V7KKTkBu2nBKGJRPYppyBsoES5Z2++gqNh05GmNuYP/dJKIJlChBAavrnM5xrXdFPotqrmXOfWzSbtQSiravVpaS9+6x1lWDPbt7xRfVYJ5kL2uR8U8A8jC2OhFK2yTGv3IHum/yUL7OwdOA3nY0F1izMDIQ== Received: from CO1NAM04FT019.eop-NAM04.prod.protection.outlook.com (10.152.90.53) by CO1NAM04HT082.eop-NAM04.prod.protection.outlook.com (10.152.91.148) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_CBC_SHA384) id 15.20.2136.14; Mon, 5 Aug 2019 15:27:57 +0000 Received: from BYAPR08MB5014.namprd08.prod.outlook.com (10.152.90.58) by CO1NAM04FT019.mail.protection.outlook.com (10.152.90.93) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.2136.14 via Frontend Transport; Mon, 5 Aug 2019 15:27:57 +0000 Received: from BYAPR08MB5014.namprd08.prod.outlook.com ([fe80::14bd:c37b:f3b4:ccb1]) by BYAPR08MB5014.namprd08.prod.outlook.com ([fe80::14bd:c37b:f3b4:ccb1%4]) with mapi id 15.20.2136.018; Mon, 5 Aug 2019 15:27:57 +0000 From: Julie Nishimura To: Alban Hertroys CC: Adrian Klaver , "pgsql-general@lists.postgresql.org" , pgsql-general Subject: Re: adding more space to the existing server Thread-Topic: adding more space to the existing server Thread-Index: AQHVR+47+VDkybsuokiFFImEHrXsTKbmWwwAgAHkX+uAAPmYAIACYfYtgADgLACAADiamg== Date: Mon, 5 Aug 2019 15:27:57 +0000 Message-ID: References: <13358DF7-5700-44A2-A86B-2A3721AA9650@gmail.com> , In-Reply-To: Accept-Language: en-US Content-Language: en-US X-MS-Has-Attach: X-MS-TNEF-Correlator: x-incomingtopheadermarker: OriginalChecksum:03996F83A1430494DA7A8ABC0F074AFCCD82DCB73C2F23823B92FBEF91989AE2;UpperCasedChecksum:DC65E05E07CBC5FDCAF105AA62A95262E5AE5B4681D8C646E3397C4DF262659F;SizeAsReceived:7301;Count:44 x-ms-exchange-messagesentrepresentingtype: 1 x-tmn: [xA1BeIYRt6N4CyFllBlVBiWnz6wxNpA1] x-ms-publictraffictype: Email x-incomingheadercount: 44 x-eopattributedmessage: 0 x-microsoft-antispam: BCL:0;PCL:0;RULEID:(2390118)(5050001)(7020095)(20181119110)(201702061078)(5061506573)(5061507331)(1603103135)(2017031320274)(2017031322404)(2017031323274)(2017031324274)(1601125500)(1603101475)(1701031045);SRVR:CO1NAM04HT082; x-ms-traffictypediagnostic: CO1NAM04HT082: x-microsoft-antispam-message-info: YRtafPl/mX22j8omrW7+Dr9p77SfRKcH/HyGmO6yJnL2/TzREklP241tRe93JT97YIgw4JoqcJhyPUjzls7HQGGGnu1An3n4L5P/6VM81Cblgs9iS2DJUouMzXOVqrTgplz+1BbLbK5KcCEiwC2dSYVkbnU7wcewLYo3GMNVoJX5K22ea73OGzIvsq1vEL06 Content-Type: multipart/alternative; boundary="_000_BYAPR08MB5014ACAC05363CDF09DC67C2ACDA0BYAPR08MB5014namp_" MIME-Version: 1.0 X-OriginatorOrg: hotmail.com X-MS-Exchange-CrossTenant-RMS-PersistedConsumerOrg: 00000000-0000-0000-0000-000000000000 X-MS-Exchange-CrossTenant-Network-Message-Id: fcc02ea8-349c-4d4b-5334-08d719b97e89 X-MS-Exchange-CrossTenant-rms-persistedconsumerorg: 00000000-0000-0000-0000-000000000000 X-MS-Exchange-CrossTenant-originalarrivaltime: 05 Aug 2019 15:27:57.8028 (UTC) X-MS-Exchange-CrossTenant-fromentityheader: Internet X-MS-Exchange-CrossTenant-id: 84df9e7f-e9f6-40af-b435-aaaaaaaaaaaa X-MS-Exchange-Transport-CrossTenantHeadersStamped: CO1NAM04HT082 List-Id: List-Help: List-Subscribe: List-Post: List-Owner: List-Archive: Precedence: bulk --_000_BYAPR08MB5014ACAC05363CDF09DC67C2ACDA0BYAPR08MB5014namp_ Content-Type: text/plain; charset="Windows-1252" Content-Transfer-Encoding: quoted-printable Thanks for your reply Alban. Currently we only have A->B replication. Is ad= ding B->C replication difficult? I remember in the past I tried to seed pg_= basebackup from hot standby, and it was erroring out after awhile, so neede= d to switch to run from master. ________________________________ From: Alban Hertroys Sent: Monday, August 5, 2019 5:01 AM To: Julie Nishimura Cc: Adrian Klaver ; pgsql-general@lists.postgres= ql.org ; pgsql-general Subject: Re: adding more space to the existing server On 5 Aug 2019, at 0:39, Julie Nishimura > wrote: Alban, thank you for your reply. Your suggestion makes sense, and I will be= talking to our engineers about it. Currently we need to understand: a) How do we break A -> B replication such that both can become indep= endent primaries That is pretty much like normal failover from A to B, except that you don= =92t reverse replication. You will need to stop your clients from sending data for a bit (if it=92s c= ontinuous data, having a buffer in between is a big help - at our company w= e=92re looking into Apache Kafka for that), so that you can switch half of = them to connect to B instead of A. Next, you promote B to master. I used the docs for that last time, and they= were pretty clear on the subject. b) How do we reassign C from B->C replication to A->C replication I don=92t think you need to. If you indeed already have A->B->C, after prom= oting B to master, you end up with B->C, which is alright. You just need to add A->D for the other set. c) Thoughts on why this isn=92t a good plan That depends on your clients and how you decide which database in the curre= nt cluster they connect to. If you connect specific clients to specific dat= abases, then all you need to do is to configure half your clients to connec= t to B instead. Another option is to put a virtual database layer in front, such that both = clusters still look like a single database to the outside world. We have so= me experience with Dremio for similar purposes (although for read-only repo= rting). Mind that the community edition doesn=92t do authorization. Current: A replicates to B all requests go to A Soon: A replicates to B -> cascading to C and D Transition: break A replication to B such that both can become primary Correct. stop B replication to C then setup A to replicate to C I would change this in: setup A to replicate to D End state: A replicates to C B replicates to D End state: A replicates to D B replicates to C we remove some of the dbs from A and B, then reassign the traffic based on = db selections I hope it all makes sense... Thank you It does to me. Now would be a good time for people to chime in if they don'= t agree ;) From: Alban Hertroys > Sent: Saturday, August 3, 2019 3:15 AM To: Julie Nishimura > Cc: Adrian Klaver >; pgsql-general@lists.postgresql.org >; pgsql-general > Subject: Re: adding more space to the existing server > On 2 Aug 2019, at 21:45, Julie Nishimura > wrote: > 1) We use streaming replication, and due to hardware limitation, we canno= t add more drives to the existing host. That is why we thought by breaking = the existing streaming replication (from a->b), instead of currently identi= cal standby (b), we can introduce twice larger host, then start the replica= tion to the newly larger host, and when it is caught up, break it again. Th= en break rep again, make modification to 'a" host, making it larger, then r= eplicate b->a. After it is caught up, break the rep again, switch master->s= tandby (if necessary). Let=92s be clear, I=92m in no way an expert on replication. In fact, I=92ve= only done (streaming) replication once and I managed to mess that up in a = minor way (disabled the wrong service during failover, so data still went t= o the database I was attempting to replace for, like, 15 minutes). > 2) I am not sure about the time, but it is understood it is required 2 fu= ll replication cycles, and might be up to 2 weeks with no standby situation No standby situation? Murphy is probably just waiting for that to strike=85 I recall a fairly recent story on the FreeBSD ML about someone on Malta doi= ng a migration of a couple dozen terabytes from her main server (because of= some failing disks in her RAID set) using her backup server to move data a= round (with backups removed to make room), when, due to an accident outside= the building, an aerial 10KV power line hit another power line in the grou= nd, causing a fire in one UPS and frying the other one. Losing power at tha= t point meant that the file systems (ZFS) on both servers ended up in an un= recoverable state with no backups. It didn=92t help that the UPS=92s were a= t the bottom of the rack, with the heat and smoke going up into the servers= . What are the chances, right? (And then it turned out that it is really ha= rd to try to recover data from a ZFS file system in such a state, which is = what her actual inquiry was about) I would definitely prefer to add a 3rd machine into the mix, even if it wer= e just a temporary machine - a rental perhaps?