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 1j5dd1-0007Z6-TW for pgsql-general@arkaria.postgresql.org; Sat, 22 Feb 2020 22:52:08 +0000 Received: from localhost ([127.0.0.1] helo=malur.postgresql.org) by malur.postgresql.org with esmtp (Exim 4.89) (envelope-from ) id 1j5dd0-0001my-Hx for pgsql-general@arkaria.postgresql.org; Sat, 22 Feb 2020 22:52:06 +0000 Received: from magus.postgresql.org ([2a02:c0:301:0:ffff::29]) by malur.postgresql.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_CBC_SHA1:256) (Exim 4.89) (envelope-from ) id 1j5dcz-0001mr-Mk for pgsql-general@lists.postgresql.org; Sat, 22 Feb 2020 22:52:06 +0000 Received: from mail-bn7nam10olkn2066.outbound.protection.outlook.com ([40.92.40.66] helo=NAM10-BN7-obe.outbound.protection.outlook.com) by magus.postgresql.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.92) (envelope-from ) id 1j5dcv-0007Wd-7W for pgsql-general@postgresql.org; Sat, 22 Feb 2020 22:52:04 +0000 ARC-Seal: i=1; a=rsa-sha256; s=arcselector9901; d=microsoft.com; cv=none; b=mhPAU3rc7nTE0nnhTtFIzcNJyHjGfgtx+5Cd9b8i0xufU6nCn6RTCc9pa5syCHFaaDi//AX83TF9GfODS6H+rYXOXslYWQvIng3VKDcWAkhp1rXtFuX+Pr0l/hLGKWhL8b9N5to0wCcz9vDfL0hW+FcnZ/H++xU2c+qrtYTJtbalPtO1DO7O/h80I+fTesDwGE9K3Grar6tkMLLtO/foyTf6VlHvQEwqB12hJNxoC7saT8QepPY3a52Ie7a8VdaQNgFkkbH5+11SCW6Sd0XQv3yK/evGOf0Cw7T/KHgqdnLnWf+UqdqQyk3L5QtKd/Ap/dzDZ3b3h6gt2Hv+RcztAg== 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=O4yhUTEdhAnsaTPzSB5nZeihMWhQE+Vcg5kdE5FZVas=; b=kt3qHg/lPSzjH2kFAve3pFktOaU2jn9fmN0FWdpqf907iRN2w/CdbRYxOtNHHgEX6tyHN39HOm4amOU5onBjE0s5CxdXcMUX9wLm99NIUgS3NgZ1Q7UdRSyELWuHY1KakxLsLm98oxFErUT3k9ljx+/AaCtxlSxDe18GegEk9uRpCk7MnKk45I+hApQmLEEN1mMwAx9wpKv20tzPgWZwiuMT+NDOq3VmLpbpMHc4YdQFt5V9hTOVHgn/1E2VqfZNRK/f+c33OmQdVsHI+IH9nhv9AS2N3h4rLCLCTSxKfbQPOmNXRSCnGY4M4t8ZAYfbkabj7X7qojHs+KWmIVEO/A== 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=O4yhUTEdhAnsaTPzSB5nZeihMWhQE+Vcg5kdE5FZVas=; b=PrTFprtw/FQTSYZt4rxfAZveONOxx/LdXa2Wu46tJxC5VROQcE08s1pmhPEw7JcWgH9qeD18GNESpFzxOeWX2YIma0jwZ6O+lb+TboA8dvgL0rwgjy64aolAOjZaLkYrbNn9jCFWST2yGMJPlNEe12eNFv0k+ID8b6dbheB7u57ZnaJVSmu6VeSYsUUSNPqfsemHDB9+6CUSk2RIWRL/gUwTpPvaefAMYtGMax9+FsKGWNn3tm4e1JiJyvqb8QdpZqbwuxZMNWFIK/yKkPm6UIL6UA+Hf0snD3VPt/FO5/67XZ/qkloKvKCsvHpZG+g5ybpVsoPp/zpkt6k/5kWBRQ== Received: from MW2NAM10FT017.eop-nam10.prod.protection.outlook.com (2a01:111:e400:7e87::3c) by MW2NAM10HT023.eop-nam10.prod.protection.outlook.com (2a01:111:e400:7e87::330) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.2750.19; Sat, 22 Feb 2020 22:51:56 +0000 Received: from MN2PR01MB5327.prod.exchangelabs.com (2a01:111:e400:7e87::3c) by MW2NAM10FT017.mail.protection.outlook.com (2a01:111:e400:7e87::478) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.2750.19 via Frontend Transport; Sat, 22 Feb 2020 22:51:56 +0000 Received: from MN2PR01MB5327.prod.exchangelabs.com ([fe80::651e:5e33:5b2a:adee]) by MN2PR01MB5327.prod.exchangelabs.com ([fe80::651e:5e33:5b2a:adee%7]) with mapi id 15.20.2750.021; Sat, 22 Feb 2020 22:51:56 +0000 From: Edson Richter To: Adrian Klaver , pgsql-general Subject: RE: Replication: slave server has 3x size of production server? Thread-Topic: Replication: slave server has 3x size of production server? Thread-Index: AQHV6aRUnElZAlVhK0CJQqY7zlebK6gneSSAgAAHgLmAAA33AIAAAj6UgAAE5gCAAACDUYAAIC2AgAAaoM8= Date: Sat, 22 Feb 2020 22:51:56 +0000 Message-ID: References: <98f036e0-9bf2-8798-8742-9dba0601fb9a@aklaver.com> <590174e0-256a-fe72-468a-0bcf77ca0df8@aklaver.com> ,<46ab8dff-645a-0521-16e8-821db6fc6d9c@aklaver.com> In-Reply-To: <46ab8dff-645a-0521-16e8-821db6fc6d9c@aklaver.com> Accept-Language: pt-BR, en-US Content-Language: pt-BR X-MS-Has-Attach: X-MS-TNEF-Correlator: x-incomingtopheadermarker: OriginalChecksum:31CF38CC9AB51DDD44DD90CD3457F661BF3483444E81E39EC0D29BC4FCE46D8A;UpperCasedChecksum:0B9FE20FA9A850014997A985267B2CF6E3D95BEFF243AA6E2ECAAF63ED840353;SizeAsReceived:7452;Count:45 x-ms-exchange-messagesentrepresentingtype: 1 x-tmn: [jPm1lIYADV6ofXtdGEKzP2MVUyNgWG26] x-ms-publictraffictype: Email x-incomingheadercount: 45 x-eopattributedmessage: 0 x-ms-office365-filtering-correlation-id: d347945b-552c-4ec4-197e-08d7b7e9d16e x-ms-traffictypediagnostic: MW2NAM10HT023: x-microsoft-antispam: BCL:0; x-microsoft-antispam-message-info: gShkBh1AdB7WOLYNt+jNxJP4L4QBEgRxZwr9bUTPtV8noyjuiVRQIAWqnkKDh2fqQM4trVCtXAM0IaBhCZ6LTWFEUeJYlYit1ok9Y52N9GEZuUKrKEpaXX2pl42eK/izA5o/BRV9iMS6xBruIv04qDqzmcFSj0F/5lDjwsb+Ddh8HmyE53+AoKtSZrzL+dMx x-ms-exchange-antispam-messagedata: XxLGt0FXBx0T3QNSU5XboSwTWxoXbQkmAjfxtrat156ZpRwwM99v2KHfiD/eCwIlXbZBePqI9ZyRdY/Z7rwVbPj06SoGB0d0bkgKuGZFQ0zBE8Zityx5wijwnroTq6/QBOiYTbiFbnCZrBafB+K+8w== x-ms-exchange-transport-forked: True Content-Type: multipart/alternative; boundary="_000_MN2PR01MB53274CD8D050FBE6F824DC2ECFEE0MN2PR01MB5327prod_" 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: d347945b-552c-4ec4-197e-08d7b7e9d16e X-MS-Exchange-CrossTenant-rms-persistedconsumerorg: 00000000-0000-0000-0000-000000000000 X-MS-Exchange-CrossTenant-originalarrivaltime: 22 Feb 2020 22:51:56.3671 (UTC) X-MS-Exchange-CrossTenant-fromentityheader: Internet X-MS-Exchange-CrossTenant-id: 84df9e7f-e9f6-40af-b435-aaaaaaaaaaaa X-MS-Exchange-Transport-CrossTenantHeadersStamped: MW2NAM10HT023 List-Id: List-Help: List-Subscribe: List-Post: List-Owner: List-Archive: Precedence: bulk --_000_MN2PR01MB53274CD8D050FBE6F824DC2ECFEE0MN2PR01MB5327prod_ Content-Type: text/plain; charset="iso-8859-1" Content-Transfer-Encoding: quoted-printable ________________________________ De: Adrian Klaver Enviado: s=E1bado, 22 de fevereiro de 2020 18:12 Para: Edson Richter ; pgsql-general Assunto: Re: Replication: slave server has 3x size of production server? On 2/22/20 11:23 AM, Edson Richter wrote: > ---------------------------------------------------------------------= --- > > *De:* Adrian Klaver > *Enviado:* s=E1bado, 22 de fevereiro de 2020 16:16 > *Para:* Edson Richter ; pgsql-general > > *Assunto:* Re: Replication: slave server has 3x size of production > server? > On 2/22/20 11:03 AM, Edson Richter wrote: > > ---------------------------------------------------------------= --------- > > > > > > > > > Streaming replication. Initiated via pg_basebackup. > > > > Settings on master server: > > > > # - Sending Server(s) - > > # Set these on the master and on any standby that will send replica= tion > > data. > > max_wal_senders =3D 2 # max number of walsender process= es > > (change requires restart) > > wal_keep_segments =3D 25 # in logfile segments, 16MB each;= 0 disables > > #wal_sender_timeout =3D 60s # in milliseconds; 0 disables > > max_replication_slots =3D 2 # max number of replication > > slots (change requires restart) > > #track_commit_timestamp =3D off # collect timestamp of transactio= n > > commit (change requires restart) > > # - Master Server - > > # These settings are ignored on a standby server. > > #synchronous_standby_names =3D '' # standby servers that provide sy= nc > > rep number of sync standbys and comma-separated list of > > application_name from standby(s); '*' =3D all > > #vacuum_defer_cleanup_age =3D 0 # number of xacts by which cleanu= p is > > delayed > > > > > > > > Settings on slave server: > > > > # - Standby Servers - > > # These settings are ignored on a master server. > > hot_standby =3D on # "on" allows queries dur= ing > > recovery (change requires restart) > > max_standby_archive_delay =3D -1 # max delay before cancel= ing > > queries when reading WAL from archive; -1 allows indefinite delay > > max_standby_streaming_delay =3D -1 # max delay before cancel= ing > > queries when reading streaming WAL; -1 allows indefinite delay > > wal_receiver_status_interval =3D 10s # send replies at least t= his > > often 0 disables > > hot_standby_feedback =3D on # send info from standby = to > > prevent query conflicts > > wal_receiver_timeout =3D 0 # time that receiver wait= s for > > communication from master in milliseconds; 0 disables > > wal_retrieve_retry_interval =3D 5s # time to wait before ret= rying > > to retrieve WAL after a failed attempt > > What are the settings for: > > archive_mode > archive_command > > on the standby? > > Are the files in pg_xlog on the standby mostly from well in the past? > > > Actually, standby server is sending wals to a backup (barman) server: > > archive_mode =3D always # enables archiving; off, on, or always > (change requires restart) > archive_command =3D 'rsync -e "ssh -2 -C -p 2022" -az %p > barman@192.168.0.2:/dados/barman/dbcluster/incoming/%f' And the above is working, the files are showing up on the barman server? Yes, it is working. Last X'log file is present on all thee servers. Also, comparting last transaction number on master and slave shows that all= are in sync. Last, but not least, select max(id) from a busy table shows same id (when q= ueried almost simultaneously using a simple test routine). > > > The files are about 7 months old. Are there newer files that would indicate that the streaming is working? Yes, streaming is working properly (as stated above). Thanks, Edson Richter > > > Thanks, > > Edson > > > > > > > Regards, > > > > Edson > > > > > > > > > > > Edson > > > > > > > -- > > Adrian Klaver > > adrian.klaver@aklaver.com > > > > > -- > Adrian Klaver > adrian.klaver@aklaver.com > -- Adrian Klaver adrian.klaver@aklaver.com --_000_MN2PR01MB53274CD8D050FBE6F824DC2ECFEE0MN2PR01MB5327prod_ Content-Type: text/html; charset="iso-8859-1" Content-Transfer-Encoding: quoted-printable


De: Adrian= Klaver <adrian.klaver@aklaver.com>
Enviado: s=E1bado, 22 de fevereiro de 2020 18:12
Para: Edson Richter <edsonrichter@hotmail.com>; pgsql-general = <pgsql-general@postgresql.org>
Assunto: Re: Replication: slave server has 3x size of production ser= ver?
 
On 2/22/20 11:23 AM, Edson Richter wrote:
>     ----------------------------------------------= --------------------------
>
>     *De:* Adrian Klaver <adrian.klaver@aklaver.= com>
>     *Enviado:* s=E1bado, 22 de fevereiro de 2020 1= 6:16
>     *Para:* Edson Richter <edsonrichter@hotmail= .com>; pgsql-general
>     <pgsql-general@postgresql.org>
>     *Assunto:* Re: Replication: slave server has 3= x size of production
>     server?
>     On 2/22/20 11:03 AM, Edson Richter wrote:
>     >     -----------------= -------------------------------------------------------
>     >
>
>     >
>     >
>     > Streaming replication. Initiated via pg_b= asebackup.
>     >
>     > Settings on master server:
>     >
>     > # - Sending Server(s) -
>     > # Set these on the master and on any stan= dby that will send replication
>     > data.
>     > max_wal_senders =3D 2      = ;       # max number of walsender processes
>     > (change requires restart)
>     > wal_keep_segments =3D 25     &n= bsp;    # in logfile segments, 16MB each; 0 disables
>     > #wal_sender_timeout =3D 60s    =   # in milliseconds; 0 disables
>     > max_replication_slots =3D 2    =   # max number of replication
>     > slots (change requires restart)
>     > #track_commit_timestamp =3D off   # = collect timestamp of transaction
>     > commit (change requires restart)
>     > # - Master Server -
>     > # These settings are ignored on a standby= server.
>     > #synchronous_standby_names =3D '' # stand= by servers that provide sync
>     > rep number of sync standbys and comm= a-separated list of
>     > application_name from standby(s); '*= ' =3D all
>     > #vacuum_defer_cleanup_age =3D 0   # = number of xacts by which cleanup is
>     > delayed
>     >
>     >
>     >
>     > Settings on slave server:
>     >
>     > # - Standby Servers -
>     > # These settings are ignored on a master = server.
>     > hot_standby =3D on       &= nbsp;                # "on&quo= t; allows queries during
>     > recovery (change requires restart)
>     > max_standby_archive_delay =3D -1   &= nbsp;      # max delay before canceling
>     > queries when reading WAL from archive; -1= allows indefinite delay
>     > max_standby_streaming_delay =3D -1  =      # max delay before canceling
>     > queries when reading streaming WAL; -1 al= lows indefinite delay
>     > wal_receiver_status_interval =3D 10s &nbs= p;    # send replies at least this
>     > often 0 disables
>     > hot_standby_feedback =3D on    =           # send info from standby to
>     > prevent query conflicts
>     > wal_receiver_timeout =3D 0     =            # time that receiver waits for >     > communication from master in milliseconds= ; 0 disables
>     > wal_retrieve_retry_interval =3D 5s  =      # time to wait before retrying
>     > to retrieve WAL after a failed attempt >
>     What are the settings for:
>
>     archive_mode
>     archive_command
>
>     on the standby?
>
>     Are the files in pg_xlog on the standby mostly= from well in the past?
>
>
> Actually, standby server is sending wals to a backup (barman) server:<= br> >
> archive_mode =3D always           # enables a= rchiving; off, on, or always
> (change requires restart)
> archive_command =3D 'rsync -e "ssh -2 -C -p 2022" -az %p > barman@192.168.0.2:/dados/barman/dbcluster/incoming/%f'

And the above is working, the files are showing up on the barman server?

Yes, it is working. Last X'log file is present on = all thee servers.
Also, comparting last transaction number on master= and slave shows that all are in sync.
Last, but not least, select max(id) from a busy ta= ble shows same id (when queried almost simultaneously using a simple test r= outine).

>
>
> The files are about 7 months old.

Are there newer files that would indicate that the streaming is working?

Yes, streaming is working properly (as stated above).

Thanks,


Edson Richter


>
>
> Thanks,
>
> Edson
>
>     >
>     >
>     > Regards,
>     >
>     > Edson
>     >
>     >     >
>     >     >
>     >     > Edson
>     >     >
>     >
>     >     --
>     >     Adrian Klaver
>     >     adrian.klaver@akl= aver.com
>     >
>
>
>     --
>     Adrian Klaver
>     adrian.klaver@aklaver.com
>


--
Adrian Klaver
adrian.klaver@aklaver.com
--_000_MN2PR01MB53274CD8D050FBE6F824DC2ECFEE0MN2PR01MB5327prod_--