pg.ddx.io  pgsql-admin@postgresql.org mailing list archive  
help / color / mirror / Atom feed
Wal keep segment
5+ messages / 3 participants
[nested] [flat]

* Wal keep segment
@ 2020-04-25 12:09 Raj kumar <rajkumar820999@gmail.com>
  2020-04-25 12:14 ` Re: Wal keep segment John Scalia <jayknowsunix@gmail.com>
  0 siblings, 1 reply; 5+ messages in thread

From: Raj kumar @ 2020-04-25 12:09 UTC (permalink / raw)
  To: pgsql-admin@lists.postgresql.org

Hi,

I have "wal_keep_segment" set as 256.
But I could see that around 700 files are present inside pg_wal directory.

I thought after reaching 256, wal writer will start overwriting from 1st.

What is the upper limit of these number of wal files in the directory?

Thanks and regards
Raj kumar

^ permalink  raw  reply  [nested|flat] 5+ messages in thread

* Re: Wal keep segment
  2020-04-25 12:09 Wal keep segment Raj kumar <rajkumar820999@gmail.com>
@ 2020-04-25 12:14 ` John Scalia <jayknowsunix@gmail.com>
  2020-04-25 13:13   ` Re: Wal keep segment Raj kumar <rajkumar820999@gmail.com>
  0 siblings, 1 reply; 5+ messages in thread

From: John Scalia @ 2020-04-25 12:14 UTC (permalink / raw)
  To: Raj kumar <rajkumar820999@gmail.com>; +Cc: pgsql-admin@lists.postgresql.org

Wal_keep_segments is a MINIMUM setting value, meaning the database is guaranteed to keep at least that many WAL segments. If you have replication setup and it’s fallen behind or broken, then WAL segments can rapidly accumulate on a fairly busy server. I suspect without having your details that something of this nature is occurring.
—
Jay

Sent from my iPad

> On Apr 25, 2020, at 8:09 AM, Raj kumar <rajkumar820999@gmail.com> wrote:
> 
> 
> Hi,
> 
> I have "wal_keep_segment" set as 256.
> But I could see that around 700 files are present inside pg_wal directory.
> 
> I thought after reaching 256, wal writer will start overwriting from 1st.
> 
> What is the upper limit of these number of wal files in the directory?
> 
> Thanks and regards
> Raj kumar





^ permalink  raw  reply  [nested|flat] 5+ messages in thread

* Re: Wal keep segment
  2020-04-25 12:09 Wal keep segment Raj kumar <rajkumar820999@gmail.com>
  2020-04-25 12:14 ` Re: Wal keep segment John Scalia <jayknowsunix@gmail.com>
@ 2020-04-25 13:13   ` Raj kumar <rajkumar820999@gmail.com>
  2020-04-25 13:28     ` Re: Wal keep segment Don Seiler <don@seiler.us>
  0 siblings, 1 reply; 5+ messages in thread

From: Raj kumar @ 2020-04-25 13:13 UTC (permalink / raw)
  To: John Scalia <jayknowsunix@gmail.com>; +Cc: pgsql-admin@lists.postgresql.org

Hi John,

Thank you.

On Sat, 25 Apr 2020, 17:45 John Scalia, <jayknowsunix@gmail.com> wrote:

> Wal_keep_segments is a MINIMUM setting value, meaning the database is
> guaranteed to keep at least that many WAL segments. If you have replication
> setup and it’s fallen behind or broken, then WAL segments can rapidly
> accumulate on a fairly busy server. I suspect without having your details
> that something of this nature is occurring.
> —
> Jay
>
> Sent from my iPad
>
> > On Apr 25, 2020, at 8:09 AM, Raj kumar <rajkumar820999@gmail.com> wrote:
> >
> > 
> > Hi,
> >
> > I have "wal_keep_segment" set as 256.
> > But I could see that around 700 files are present inside pg_wal
> directory.
> >
> > I thought after reaching 256, wal writer will start overwriting from 1st.
> >
> > What is the upper limit of these number of wal files in the directory?
> >
> > Thanks and regards
> > Raj kumar
>

^ permalink  raw  reply  [nested|flat] 5+ messages in thread

* Re: Wal keep segment
  2020-04-25 12:09 Wal keep segment Raj kumar <rajkumar820999@gmail.com>
  2020-04-25 12:14 ` Re: Wal keep segment John Scalia <jayknowsunix@gmail.com>
  2020-04-25 13:13   ` Re: Wal keep segment Raj kumar <rajkumar820999@gmail.com>
@ 2020-04-25 13:28     ` Don Seiler <don@seiler.us>
  2020-04-26 12:21       ` Re: Wal keep segment Raj kumar <rajkumar820999@gmail.com>
  0 siblings, 1 reply; 5+ messages in thread

From: Don Seiler @ 2020-04-25 13:28 UTC (permalink / raw)
  To: Raj kumar <rajkumar820999@gmail.com>; +Cc: John Scalia <jayknowsunix@gmail.com>; Pgsql-admin <pgsql-admin@lists.postgresql.org>

On Sat, Apr 25, 2020, 08:13 Raj kumar <rajkumar820999@gmail.com> wrote:

> Hi John,
>
> Thank you.
>
> On Sat, 25 Apr 2020, 17:45 John Scalia, <jayknowsunix@gmail.com> wrote:
>
>> Wal_keep_segments is a MINIMUM setting value, meaning the database is
>> guaranteed to keep at least that many WAL segments. If you have replication
>> setup and it’s fallen behind or broken, then WAL segments can rapidly
>> accumulate on a fairly busy server. I suspect without having your details
>> that something of this nature is occurring.
>> —
>> Jay
>>
>> Sent from my iPad
>>
>> > On Apr 25, 2020, at 8:09 AM, Raj kumar <rajkumar820999@gmail.com>
>> wrote:
>> >
>> > 
>> > Hi,
>> >
>> > I have "wal_keep_segment" set as 256.
>> > But I could see that around 700 files are present inside pg_wal
>> directory.
>> >
>> > I thought after reaching 256, wal writer will start overwriting from
>> 1st.
>> >
>> > What is the upper limit of these number of wal files in the directory?
>> >
>> > Thanks and regards
>> > Raj kumar
>>
>
I would also see if you have a replication slot in use, and verify that it
actually should be in use.

Don.

>

^ permalink  raw  reply  [nested|flat] 5+ messages in thread

* Re: Wal keep segment
  2020-04-25 12:09 Wal keep segment Raj kumar <rajkumar820999@gmail.com>
  2020-04-25 12:14 ` Re: Wal keep segment John Scalia <jayknowsunix@gmail.com>
  2020-04-25 13:13   ` Re: Wal keep segment Raj kumar <rajkumar820999@gmail.com>
  2020-04-25 13:28     ` Re: Wal keep segment Don Seiler <don@seiler.us>
@ 2020-04-26 12:21       ` Raj kumar <rajkumar820999@gmail.com>
  0 siblings, 0 replies; 5+ messages in thread

From: Raj kumar @ 2020-04-26 12:21 UTC (permalink / raw)
  To: Don Seiler <don@seiler.us>; +Cc: John Scalia <jayknowsunix@gmail.com>; Pgsql-admin <pgsql-admin@lists.postgresql.org>

Hi Don,

I am using wal_keep_segments for streaming replication and not replication
slots.
max_replication_slots is provided as 10 inside postgresql.conf, but no
replication slots are actually used, as you can see them from the below
queries.


*wal_keep_segments = 256         # in logfile segments; 0 disables*
*max_replication_slots = 10 # max number of replication slots*


edb=# select * from pg_replication_slots ;
 slot_name | plugin | slot_type | datoid | database | temporary | active |
active_pid | xmin | catalog_xmin | restart_l
sn | confirmed_flush_lsn
-----------+--------+-----------+--------+----------+-----------+--------+------------+------+--------------+----------
---+---------------------
(0 rows)

edb=#

edb=# select * from pg_stat_replication ;
-[ RECORD 1 ]----+---------------------------------
pid              | 19445
backend_xmin     |
state            | streaming
sent_lsn         | 1B3/A6000000
write_lsn        | 1B3/A6000000
flush_lsn        | 1B3/A6000000
replay_lsn       | 1B3/A6000000
write_lag        |
flush_lag        |
replay_lag       |
sync_priority    | 0
sync_state       | async

Thanks and Regards,
Raj Kumar

On Sat, Apr 25, 2020 at 6:59 PM Don Seiler <don@seiler.us> wrote:

> On Sat, Apr 25, 2020, 08:13 Raj kumar <rajkumar820999@gmail.com> wrote:
>
>> Hi John,
>>
>> Thank you.
>>
>> On Sat, 25 Apr 2020, 17:45 John Scalia, <jayknowsunix@gmail.com> wrote:
>>
>>> Wal_keep_segments is a MINIMUM setting value, meaning the database is
>>> guaranteed to keep at least that many WAL segments. If you have replication
>>> setup and it’s fallen behind or broken, then WAL segments can rapidly
>>> accumulate on a fairly busy server. I suspect without having your details
>>> that something of this nature is occurring.
>>> —
>>> Jay
>>>
>>> Sent from my iPad
>>>
>>> > On Apr 25, 2020, at 8:09 AM, Raj kumar <rajkumar820999@gmail.com>
>>> wrote:
>>> >
>>> > 
>>> > Hi,
>>> >
>>> > I have "wal_keep_segment" set as 256.
>>> > But I could see that around 700 files are present inside pg_wal
>>> directory.
>>> >
>>> > I thought after reaching 256, wal writer will start overwriting from
>>> 1st.
>>> >
>>> > What is the upper limit of these number of wal files in the directory?
>>> >
>>> > Thanks and regards
>>> > Raj kumar
>>>
>>
> I would also see if you have a replication slot in use, and verify that it
> actually should be in use.
>
> Don.
>
>>

^ permalink  raw  reply  [nested|flat] 5+ messages in thread


end of thread, other threads:[~2020-04-26 12:21 UTC | newest]

Thread overview: 5+ messages (download: mbox mbox.gz follow: Atom feed)
-- links below jump to the message on this page --
2020-04-25 12:09 Wal keep segment Raj kumar <rajkumar820999@gmail.com>
2020-04-25 12:14 ` John Scalia <jayknowsunix@gmail.com>
2020-04-25 13:13   ` Raj kumar <rajkumar820999@gmail.com>
2020-04-25 13:28     ` Don Seiler <don@seiler.us>
2020-04-26 12:21       ` Raj kumar <rajkumar820999@gmail.com>

This inbox is served by DDX for PostgreSQL; see mirroring instructions
for how to clone and mirror all data and code used for this inbox