Re: [HACKERS] Restricting maximum keep segments by repslots

From: Kyotaro Horiguchi <horikyota(dot)ntt(at)gmail(dot)com>
To: jgdr(at)dalibo(dot)com
Cc: andres(at)anarazel(dot)de, michael(at)paquier(dot)xyz, sawada(dot)mshk(at)gmail(dot)com, peter(dot)eisentraut(at)2ndquadrant(dot)com, pgsql-hackers(at)lists(dot)postgresql(dot)org, thomas(dot)munro(at)enterprisedb(dot)com, sk(at)zsrv(dot)org, michael(dot)paquier(at)gmail(dot)com
Subject: Re: [HACKERS] Restricting maximum keep segments by repslots
Date: 2019-07-31 07:56:16
Message-ID: 20190731.165616.261402513.horikyota.ntt@gmail.com
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-hackers

At Tue, 30 Jul 2019 21:30:45 +0900 (Tokyo Standard Time), Kyotaro Horiguchi <horikyota(dot)ntt(at)gmail(dot)com> wrote in <20190730(dot)213045(dot)221405075(dot)horikyota(dot)ntt(at)gmail(dot)com>
> I attach the revised patch. I'll repost the polished version
> sooner.

This is the revised patch.

- Status criteria has been changed.

"streaming" : restart_lsn is within max_wal_size. (and kept)

"keeping" : restart_lsn is behind max_wal_size but still kept
by max_slot_wal_keep_size or wal_keep_segments.

"losing" : The segment for restart_lsn is being lost or has
been lost, but active walsender (or session) using the
slot is still running. If the walsender caught up before
stopped, the state will transfer to "keeping" or
"streaming" again.

"lost" : The segment for restart_lsn has been lost and the
active session on the slot is gone. The standby cannot
continue replication using this slot.

null : restart_lsn is null (never activated).

- remain is null if restart_lsn is null (never activated) or
wal_status is "losing" or "lost".

- catalogs.sgml is updated.

- Refactored GetLsnAvailability and GetOldestKeepSegment and
pg_get_replication_slots.

- TAP test is fied. But test for "losing" state cannot be done
since it needs interactive session. (I think using isolation
tester is too much)..

reards.

--
Kyotaro Horiguchi
NTT Open Source Software Center

Attachment Content-Type Size
v16-0001-Add-WAL-relief-vent-for-replication-slots.patch text/x-patch 10.4 KB
v16-0002-Add-monitoring-aid-for-max_slot_wal_keep_size.patch text/x-patch 13.0 KB
v16-0003-Add-primary_slot_name-to-init_from_backup-in-TAP-tes.patch text/x-patch 1.0 KB
v16-0004-TAP-test-for-the-slot-limit-feature.patch text/x-patch 8.1 KB
v16-0005-Documentation-for-slot-limit-feature.patch text/x-patch 5.0 KB
v16-0006-Check-removal-of-in-reading-segment-file.patch text/x-patch 2.4 KB

In response to

Responses

Browse pgsql-hackers by date

  From Date Subject
Next Message Masahiko Sawada 2019-07-31 07:58:49 Re: [Proposal] Table-level Transparent Data Encryption (TDE) and Key Management Service (KMS)
Previous Message Masahiko Sawada 2019-07-31 07:40:11 Re: [Proposal] Table-level Transparent Data Encryption (TDE) and Key Management Service (KMS)