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 1j5a3q-0000oI-LF for pgsql-general@arkaria.postgresql.org; Sat, 22 Feb 2020 19:03:35 +0000 Received: from localhost ([127.0.0.1] helo=malur.postgresql.org) by malur.postgresql.org with esmtp (Exim 4.89) (envelope-from ) id 1j5a3p-0002BL-Fu for pgsql-general@arkaria.postgresql.org; Sat, 22 Feb 2020 19:03:33 +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 1j5a3o-0002BD-QE for pgsql-general@lists.postgresql.org; Sat, 22 Feb 2020 19:03:33 +0000 Received: from mail-oln040092005023.outbound.protection.outlook.com ([40.92.5.23] helo=NAM02-SN1-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 1j5a3l-0005mk-08 for pgsql-general@postgresql.org; Sat, 22 Feb 2020 19:03:32 +0000 ARC-Seal: i=1; a=rsa-sha256; s=arcselector9901; d=microsoft.com; cv=none; b=fC1DijzytwL8pzTMzoeGWn6VeY/J4k+NDyOqoS7xF6EakZTiiA+UE+6OdtbccaZJc7/CcsSwfNz1ORGlBp0oV/rUrgovi3IU6VkRnkhZKw9uHygBXyOO+7OeIm+1kHxz6FPUHgxBikfEsOYrnsalCu4uQJuP2o+hXMyhC6tNBC2gLw23qPEqgXZycr3hJjohNprvA5oyf1vFh1ZgQ45siWCK+CZEZks56cr89FnLj5wHZp3lQuVw6l6o+Xv8oGCkseNzKYKQnw3ClbtufxCmBflJpqo43NsPQy1kFVvFWIuzOZbSvufNcVhVQcE9ACOUj1fglWbOfcy4jt7nBqk9UA== 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=u7abC68vlkScTlKLr3rNPvQaCoKYfWeu9+xVh3UwlHo=; b=TgPatJCKtZ6cVI+opC2Uz4xbI8xew/bEPEjVEFkrMWzq2EQLTGwjSKAjjatmhHkND11h/1dSCJo0nLxvcMAR9GKoKRggjRk/EgO9J2B8mx+8kqbD80gV8EWNeB5Z5lYWfN+qWUkEV8ssX8fPzkOQidyY9fPN/JFGkOffb4KiKUOgbRBqVIlWXj2mLvYneMxz3wL6rWFMhfx/b8gc68cCmHS+/QLH2Wuk2Yze6XqAiuyljfXcLyKRd489qnG0qoB5/D9Wuo62yHKaXG9QYfP2MzY3ZQZsZ7SzZ7iIjJKm0OAGv6NCU6g1LqudL8PEPALjH4pdbIQUu1cUJ9uUBJAEmQ== 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=u7abC68vlkScTlKLr3rNPvQaCoKYfWeu9+xVh3UwlHo=; b=tu1IQFvAPh+v8h/IKG9rBOtl7/YSfWySiNAQMLY4mlUczumJvaJFRFq1QZXQuKwhW1OnTYIdECrxTqair/QOa59qaEAUCm4LxK4bgaeQ9YkTFNPRSJy50w520tbVkj3CAfe36sRWaas+bZuKli12qlbg9ZvbQ0T6xskmNpS7zI8NbWHNDBfMECA8Ds7Hn/FcJbH4g0v1EKwBUuAfCdGKShEdwwfzg+GexGlEa9346YXo1IwK5fetftYlAFEW+TFN9wB6L59UdOobk5BGCl90LZXF8g8sWlsczXyV9YqGpoHaWpulttV6RN7ZHlVw8DtB4ry9gxH9Fr7sp8XlkWaZzQ== Received: from CY1NAM02FT058.eop-nam02.prod.protection.outlook.com (10.152.74.59) by CY1NAM02HT148.eop-nam02.prod.protection.outlook.com (10.152.75.68) 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 19:03:26 +0000 Received: from MN2PR01MB5327.prod.exchangelabs.com (2a01:111:e400:7e45::39) by CY1NAM02FT058.mail.protection.outlook.com (2a01:111:e400:7e45::149) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.2750.18 via Frontend Transport; Sat, 22 Feb 2020 19:03:26 +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 19:03:26 +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: AQHV6aRUnElZAlVhK0CJQqY7zlebK6gneSSAgAAHgLmAAA33AIAAAj6U Date: Sat, 22 Feb 2020 19:03:25 +0000 Message-ID: References: <98f036e0-9bf2-8798-8742-9dba0601fb9a@aklaver.com> ,<590174e0-256a-fe72-468a-0bcf77ca0df8@aklaver.com> In-Reply-To: <590174e0-256a-fe72-468a-0bcf77ca0df8@aklaver.com> Accept-Language: pt-BR, en-US Content-Language: pt-BR X-MS-Has-Attach: X-MS-TNEF-Correlator: x-incomingtopheadermarker: OriginalChecksum:E91C92CF3D46E32DD8EEC934783DDA6CDAD41FE83B14CF685D4006B0CB693DF9;UpperCasedChecksum:D4F411D9BE9C7E1B9906620CE1E96BBD163D10B2D371BCD6524F4BC69FBF11E9;SizeAsReceived:7169;Count:45 x-ms-exchange-messagesentrepresentingtype: 1 x-tmn: [96+UU8bjhPj3sCT2I4s1yFyKpvWhHuX4] x-ms-publictraffictype: Email x-incomingheadercount: 45 x-eopattributedmessage: 0 x-ms-office365-filtering-correlation-id: a01125c9-a6c8-4b67-1d8b-08d7b7c9e56a x-ms-traffictypediagnostic: CY1NAM02HT148: x-microsoft-antispam: BCL:0; x-microsoft-antispam-message-info: DfHH0nmzlMU5Nbv0AoRksAnaE7bAUPmG9JFi93l3tbmt45LpzNtDfHd4Hm8PmAVhtTA4rqcC51WENpUN5wNXYgzYL3GXS+KferJZeobX/v/vgNCAEuGUobgKQecjaVAR+3wNzEqluy3RoFrvTMLhFqvMnB/NeV1SnW4uCFjKeCvb8CBu2dYf3CS+QvJ6BvX8 x-ms-exchange-antispam-messagedata: DZZmT1OVngaNF2cLwktQ9HNFCIYZy9LIaDxN+2an5Cvt1x0VyBrk/+EyHsW7ShEGAlAcG8tjAQvmE0RtBCvhDueZ82g4NhxfDqv9JgvM/fjeqtDUtOcdGyPk6bimr7a/ikbODsiU0xdckNKuACzzWQ== x-ms-exchange-transport-forked: True Content-Type: multipart/alternative; boundary="_000_MN2PR01MB53271A46CE28B2FDF93EE77DCFEE0MN2PR01MB5327prod_" 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: a01125c9-a6c8-4b67-1d8b-08d7b7c9e56a X-MS-Exchange-CrossTenant-rms-persistedconsumerorg: 00000000-0000-0000-0000-000000000000 X-MS-Exchange-CrossTenant-originalarrivaltime: 22 Feb 2020 19:03:26.0281 (UTC) X-MS-Exchange-CrossTenant-fromentityheader: Internet X-MS-Exchange-CrossTenant-id: 84df9e7f-e9f6-40af-b435-aaaaaaaaaaaa X-MS-Exchange-Transport-CrossTenantHeadersStamped: CY1NAM02HT148 List-Id: List-Help: List-Subscribe: List-Post: List-Owner: List-Archive: Precedence: bulk --_000_MN2PR01MB53271A46CE28B2FDF93EE77DCFEE0MN2PR01MB5327prod_ Content-Type: text/plain; charset="iso-8859-1" Content-Transfer-Encoding: quoted-printable ________________________________ De: Adrian Klaver Enviado: s=E1bado, 22 de fevereiro de 2020 15:50 Para: Edson Richter ; pgsql-general Assunto: Re: Replication: slave server has 3x size of production server? On 2/22/20 10:05 AM, Edson Richter wrote: > ---------------------------------------------------------------------= --- > > *De:* Adrian Klaver > *Enviado:* s=E1bado, 22 de fevereiro de 2020 14:33 > *Para:* Edson Richter ; pgsql-general > > *Assunto:* Re: Replication: slave server has 3x size of production > server? > On 2/22/20 9:25 AM, Edson Richter wrote: > > Hi! > > > > I've a database cluster created at 9.6.10 linux x64 server rhel. I = made > > progressive upgrades, first upgrading slave and then upgrading mast= er. > > Actually both are running 9.6.17. > > Current production server has 196Gb in size. > > Nevertheless, the replicated (slave) server has 598 Gb in size. > > Replication server has 3x size of production server, is that normal= ? > > How are you measuring the sizes? > > > This is the command: > > du --max-depth 1 -h pgDbCluster > > > Production: > > du --max-depth 1 -h pgDbCluster > > 56M pgDbCluster/pg_log > 444K pgDbCluster/global > 4,0K pgDbCluster/pg_stat > 4,0K pgDbCluster/pg_snapshots > 16K pgDbCluster/pg_logical > 20K pgDbCluster/pg_replslot > 61M pgDbCluster/pg_subtrans > 4,0K pgDbCluster/pg_commit_ts > 465M pgDbCluster/pg_xlog > 4,0K pgDbCluster/pg_twophase > 12M pgDbCluster/pg_multixact > 4,0K pgDbCluster/pg_serial > 195G pgDbCluster/base > 284K pgDbCluster/pg_stat_tmp > 12M pgDbCluster/pg_clog > 4,0K pgDbCluster/pg_dynshmem > 12K pgDbCluster/pg_notify > 4,0K pgDbCluster/pg_tblspc > 196G pgDbCluster > > > Slave: > > du -h --max-depth 1 pgDbCluster > > 403G pgDbCluster/pg_xlog > 120K pgDbCluster/pg_log > 424K pgDbCluster/global > 0 pgDbCluster/pg_stat > 0 pgDbCluster/pg_snapshots > 4,0K pgDbCluster/pg_logical > 8,0K pgDbCluster/pg_replslot > 60M pgDbCluster/pg_subtrans > 0 pgDbCluster/pg_commit_ts > 0 pgDbCluster/pg_twophase > 11M pgDbCluster/pg_multixact > 0 pgDbCluster/pg_serial > 195G pgDbCluster/base > 12M pgDbCluster/pg_clog > 0 pgDbCluster/pg_dynshmem > 8,0K pgDbCluster/pg_notify > 12K pgDbCluster/pg_stat_tmp > 0 pgDbCluster/pg_tblspc > 598G pgDbCluster So the WAL logs are not being cleared. What replication method is being used? What are the settings for the replication? 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 replication dat= a. max_wal_senders =3D 2 # max number of walsender processes (chan= ge requires restart) wal_keep_segments =3D 25 # in logfile segments, 16MB each; 0 disab= les #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 '' # standby servers that provide sync rep n= umber of sync standbys and comma-separated list of application_name from st= andby(s); '*' =3D all #vacuum_defer_cleanup_age =3D 0 # number of xacts by which cleanup is del= ayed Settings on slave server: # - Standby Servers - # These settings are ignored on a master server. hot_standby =3D on # "on" allows queries during reco= very (change requires restart) max_standby_archive_delay =3D -1 # max delay before canceling quer= ies when reading WAL from archive; -1 allows indefinite delay max_standby_streaming_delay =3D -1 # max delay before canceling quer= ies when reading streaming WAL; -1 allows indefinite delay wal_receiver_status_interval =3D 10s # send replies at least this ofte= n 0 disables hot_standby_feedback =3D on # send info from standby to preve= nt query conflicts wal_receiver_timeout =3D 0 # time that receiver waits for co= mmunication from master in milliseconds; 0 disables wal_retrieve_retry_interval =3D 5s # time to wait before retrying to= retrieve WAL after a failed attempt Regards, Edson > > > Edson > -- Adrian Klaver adrian.klaver@aklaver.com --_000_MN2PR01MB53271A46CE28B2FDF93EE77DCFEE0MN2PR01MB5327prod_ 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 15:50
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 10:05 AM, Edson Richter wrote:
>     ----------------------------------------------= --------------------------
>
>     *De:* Adrian Klaver <adrian.klaver@aklaver.= com>
>     *Enviado:* s=E1bado, 22 de fevereiro de 2020 1= 4:33
>     *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 9:25 AM, Edson Richter wrote:
>     > Hi!
>     >
>     > I've a database cluster created at 9.6.10= linux x64 server rhel. I made
>     > progressive upgrades, first upgrading sla= ve and then upgrading master.
>     > Actually both are running 9.6.17.
>     > Current production server has 196Gb in si= ze.
>     > Nevertheless, the replicated (slave) serv= er has 598 Gb in size.
>     > Replication server has 3x size of product= ion server, is that normal?
>
>     How are you measuring the sizes?
>
>
> This is the command:
>
> du --max-depth 1 -h pgDbCluster
>
>
> Production:
>
> du --max-depth 1 -h pgDbCluster
>
> 56M     pgDbCluster/pg_log
> 444K    pgDbCluster/global
> 4,0K    pgDbCluster/pg_stat
> 4,0K    pgDbCluster/pg_snapshots
> 16K     pgDbCluster/pg_logical
> 20K     pgDbCluster/pg_replslot
> 61M     pgDbCluster/pg_subtrans
> 4,0K    pgDbCluster/pg_commit_ts
> 465M    pgDbCluster/pg_xlog
> 4,0K    pgDbCluster/pg_twophase
> 12M     pgDbCluster/pg_multixact
> 4,0K    pgDbCluster/pg_serial
> 195G    pgDbCluster/base
> 284K    pgDbCluster/pg_stat_tmp
> 12M     pgDbCluster/pg_clog
> 4,0K    pgDbCluster/pg_dynshmem
> 12K     pgDbCluster/pg_notify
> 4,0K    pgDbCluster/pg_tblspc
> 196G    pgDbCluster
>
>
> Slave:
>
> du -h --max-depth 1 pgDbCluster
>
> 403G    pgDbCluster/pg_xlog
> 120K    pgDbCluster/pg_log
> 424K    pgDbCluster/global
> 0       pgDbCluster/pg_stat
> 0       pgDbCluster/pg_snapshots
> 4,0K    pgDbCluster/pg_logical
> 8,0K    pgDbCluster/pg_replslot
> 60M     pgDbCluster/pg_subtrans
> 0       pgDbCluster/pg_commit_ts
> 0       pgDbCluster/pg_twophase
> 11M     pgDbCluster/pg_multixact
> 0       pgDbCluster/pg_serial
> 195G    pgDbCluster/base
> 12M     pgDbCluster/pg_clog
> 0       pgDbCluster/pg_dynshmem
> 8,0K    pgDbCluster/pg_notify
> 12K     pgDbCluster/pg_stat_tmp
> 0       pgDbCluster/pg_tblspc
> 598G    pgDbCluster

So the WAL logs are not being cleared.

What replication method is being used?

What are the settings for the replication?

Streaming replication. Initiated via pg_basebackup= .

Settings on master server:

# - Sending Server(s) -
# Set these on the master and on any standby that wil= l send replication data.
max_wal_senders =3D 2         &nb= sp;   # max number of walsender processes (change requires restart)
wal_keep_segments =3D 25          # in logfil= e segments, 16MB each; 0 disables
#wal_sender_timeout =3D 60s       # in milliseconds; 0 = disables
max_replication_slots =3D 2       # ma= x number of replication slots (change requires= restart)
#track_commit_timestamp =3D off   # collect timestamp of transact= ion commit (change requires restart)
# - Master Server -
# These settings are ignored on a standby server.
#synchronous_standby_names =3D '' # standby servers t= hat provide sync rep number of sync standbys a= nd comma-separated list of application_name fr= om standby(s); '*' =3D all
#vacuum_defer_cleanup_age =3D 0   # number of xacts by which clea= nup is delayed



Settings on slave server:

# - Standby Servers -
# These settings are ignored on a master server.
hot_standby =3D on          =              # "on" allows qu= eries during recovery (change requires restart= )
max_standby_archive_delay =3D -1          # m= ax delay before canceling queries when reading WAL fr= om archive; -1 allows indefinite delay<= /div>
max_standby_streaming_delay =3D -1        # max de= lay before canceling queries when reading streaming W= AL; -1 allows indefinite delay
wal_receiver_status_interval =3D 10s      # send replie= s at least this often 0 disables
hot_standby_feedback =3D on             =   # send info from standby to prevent query conf= licts
wal_receiver_timeout =3D 0             &= nbsp;  # time that receiver waits for communicat= ion from master in milliseconds; 0 disables
wal_retrieve_retry_interval =3D 5s        # time t= o wait before retrying to retrieve WAL after a failed= attempt


Regards,

Edson

>
>
> Edson
>

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