pg.ddx.io pgsql-general@postgresql.org mailing list archive
help / color / mirror / Atom feedIt is possible to force periodically switch xlog?
10+ messages / 5 participants
[nested] [flat]
* It is possible to force periodically switch xlog?
@ 2020-04-01 22:06 Edson Richter <edsonrichter@hotmail.com>
2020-04-01 22:11 ` Re: It is possible to force periodically switch xlog? Abdul Sayeed <abdulsayeed24@gmail.com>
0 siblings, 1 reply; 10+ messages in thread
From: Edson Richter @ 2020-04-01 22:06 UTC (permalink / raw)
To: pgsql-general
I would like to know if there is any parameter I can set to force postgres to switch xlog periodically, even if it not reach the 16MB size?
Thanks,
Edson.
^ permalink raw reply [nested|flat] 10+ messages in thread
* Re: It is possible to force periodically switch xlog?
2020-04-01 22:06 It is possible to force periodically switch xlog? Edson Richter <edsonrichter@hotmail.com>
@ 2020-04-01 22:11 ` Abdul Sayeed <abdulsayeed24@gmail.com>
2020-04-01 22:55 ` Re: It is possible to force periodically switch xlog? Alvaro Herrera <alvherre@2ndquadrant.com>
0 siblings, 1 reply; 10+ messages in thread
From: Abdul Sayeed @ 2020-04-01 22:11 UTC (permalink / raw)
To: Edson Richter <edsonrichter@hotmail.com>; +Cc: pgsql-general
Hi Edson,
You can switch by using below command below PG 10.
Select pg_switch_xlog();
And there is no parameter present to switch it.
Regards,
Abdul Sayeed
On Thursday, April 2, 2020, Edson Richter <edsonrichter@hotmail.com> wrote:
> I would like to know if there is any parameter I can set to force postgres
> to switch xlog periodically, even if it not reach the 16MB size?
>
> Thanks,
>
> Edson.
>
>
--
Thanks & Regards,
Abdul Sayeed
PostgreSQL DBA
Postgres Professional Certified
Skype: abdul.sayeed24
^ permalink raw reply [nested|flat] 10+ messages in thread
* Re: It is possible to force periodically switch xlog?
2020-04-01 22:06 It is possible to force periodically switch xlog? Edson Richter <edsonrichter@hotmail.com>
2020-04-01 22:11 ` Re: It is possible to force periodically switch xlog? Abdul Sayeed <abdulsayeed24@gmail.com>
@ 2020-04-01 22:55 ` Alvaro Herrera <alvherre@2ndquadrant.com>
2020-04-01 23:19 ` RE: It is possible to force periodically switch xlog? Edson Richter <edsonrichter@hotmail.com>
0 siblings, 1 reply; 10+ messages in thread
From: Alvaro Herrera @ 2020-04-01 22:55 UTC (permalink / raw)
To: Abdul Sayeed <abdulsayeed24@gmail.com>; +Cc: Edson Richter <edsonrichter@hotmail.com>; pgsql-general
On 2020-Apr-02, Abdul Sayeed wrote:
> Hi Edson,
>
> You can switch by using below command below PG 10.
>
> Select pg_switch_xlog();
>
> And there is no parameter present to switch it.
IIRC archive_timeout does precisely that.
--
Álvaro Herrera https://www.2ndQuadrant.com/
PostgreSQL Development, 24x7 Support, Remote DBA, Training & Services
^ permalink raw reply [nested|flat] 10+ messages in thread
* RE: It is possible to force periodically switch xlog?
2020-04-01 22:06 It is possible to force periodically switch xlog? Edson Richter <edsonrichter@hotmail.com>
2020-04-01 22:11 ` Re: It is possible to force periodically switch xlog? Abdul Sayeed <abdulsayeed24@gmail.com>
2020-04-01 22:55 ` Re: It is possible to force periodically switch xlog? Alvaro Herrera <alvherre@2ndquadrant.com>
@ 2020-04-01 23:19 ` Edson Richter <edsonrichter@hotmail.com>
2020-04-02 01:09 ` Re: It is possible to force periodically switch xlog? David Steele <david@pgmasters.net>
0 siblings, 1 reply; 10+ messages in thread
From: Edson Richter @ 2020-04-01 23:19 UTC (permalink / raw)
To: pgsql-general
________________________________
De: Alvaro Herrera <alvherre@2ndquadrant.com>
Enviado: quarta-feira, 1 de abril de 2020 19:55
Para: Abdul Sayeed <abdulsayeed24@gmail.com>
Cc: Edson Richter <edsonrichter@hotmail.com>; pgsql-general <pgsql-general@postgresql.org>
Assunto: Re: It is possible to force periodically switch xlog?
On 2020-Apr-02, Abdul Sayeed wrote:
> Hi Edson,
>
> You can switch by using below command below PG 10.
>
> Select pg_switch_xlog();
>
> And there is no parameter present to switch it.
IIRC archive_timeout does precisely that.
I would assume that "archive_mode" must be "on" or "always" - but I do have "archive_mode=off".
Regards,
Edson
--
Álvaro Herrera https://nam03.safelinks.protection.outlook.com/?url=https%3A%2F%2Fwww.2ndquadrant.com%2F&dat...
PostgreSQL Development, 24x7 Support, Remote DBA, Training & Services
^ permalink raw reply [nested|flat] 10+ messages in thread
* Re: It is possible to force periodically switch xlog?
2020-04-01 22:06 It is possible to force periodically switch xlog? Edson Richter <edsonrichter@hotmail.com>
2020-04-01 22:11 ` Re: It is possible to force periodically switch xlog? Abdul Sayeed <abdulsayeed24@gmail.com>
2020-04-01 22:55 ` Re: It is possible to force periodically switch xlog? Alvaro Herrera <alvherre@2ndquadrant.com>
2020-04-01 23:19 ` RE: It is possible to force periodically switch xlog? Edson Richter <edsonrichter@hotmail.com>
@ 2020-04-02 01:09 ` David Steele <david@pgmasters.net>
2020-04-02 01:22 ` Re: It is possible to force periodically switch xlog? Kyotaro Horiguchi <horikyota.ntt@gmail.com>
2020-04-02 02:29 ` RE: It is possible to force periodically switch xlog? Edson Richter <edsonrichter@hotmail.com>
0 siblings, 2 replies; 10+ messages in thread
From: David Steele @ 2020-04-02 01:09 UTC (permalink / raw)
To: Edson Richter <edsonrichter@hotmail.com>; pgsql-general; +Cc: Alvaro Herrera <alvherre@2ndquadrant.com>
On 4/1/20 7:19 PM, Edson Richter wrote:
>
> IIRC archive_timeout does precisely that.
>
> I would assume that "archive_mode" must be "on" or "always" - but I do
> have "archive_mode=off".
I'm not sure what the point of switching the WAL segment would be with
archive_mode=off.
What are you trying to accomplish?
Regards,
--
-David
david@pgmasters.net
^ permalink raw reply [nested|flat] 10+ messages in thread
* Re: It is possible to force periodically switch xlog?
2020-04-01 22:06 It is possible to force periodically switch xlog? Edson Richter <edsonrichter@hotmail.com>
2020-04-01 22:11 ` Re: It is possible to force periodically switch xlog? Abdul Sayeed <abdulsayeed24@gmail.com>
2020-04-01 22:55 ` Re: It is possible to force periodically switch xlog? Alvaro Herrera <alvherre@2ndquadrant.com>
2020-04-01 23:19 ` RE: It is possible to force periodically switch xlog? Edson Richter <edsonrichter@hotmail.com>
2020-04-02 01:09 ` Re: It is possible to force periodically switch xlog? David Steele <david@pgmasters.net>
@ 2020-04-02 01:22 ` Kyotaro Horiguchi <horikyota.ntt@gmail.com>
2020-04-02 02:31 ` RE: It is possible to force periodically switch xlog? Edson Richter <edsonrichter@hotmail.com>
1 sibling, 1 reply; 10+ messages in thread
From: Kyotaro Horiguchi @ 2020-04-02 01:22 UTC (permalink / raw)
To: david@pgmasters.net; +Cc: edsonrichter@hotmail.com; pgsql-general; alvherre@2ndquadrant.com
At Wed, 1 Apr 2020 21:09:20 -0400, David Steele <david@pgmasters.net> wrote in
> On 4/1/20 7:19 PM, Edson Richter wrote:
> > IIRC archive_timeout does precisely that.
> > I would assume that "archive_mode" must be "on" or "always" - but I do
> > have "archive_mode=off".
>
> I'm not sure what the point of switching the WAL segment would be with
> archive_mode=off.
>
> What are you trying to accomplish?
Also I'm a bit curious about that, but anyway archive_timeout works
even with archive_mode=off. The name looks being a bit off of its
substance.
regards.
--
Kyotaro Horiguchi
NTT Open Source Software Center
^ permalink raw reply [nested|flat] 10+ messages in thread
* RE: It is possible to force periodically switch xlog?
2020-04-01 22:06 It is possible to force periodically switch xlog? Edson Richter <edsonrichter@hotmail.com>
2020-04-01 22:11 ` Re: It is possible to force periodically switch xlog? Abdul Sayeed <abdulsayeed24@gmail.com>
2020-04-01 22:55 ` Re: It is possible to force periodically switch xlog? Alvaro Herrera <alvherre@2ndquadrant.com>
2020-04-01 23:19 ` RE: It is possible to force periodically switch xlog? Edson Richter <edsonrichter@hotmail.com>
2020-04-02 01:09 ` Re: It is possible to force periodically switch xlog? David Steele <david@pgmasters.net>
2020-04-02 01:22 ` Re: It is possible to force periodically switch xlog? Kyotaro Horiguchi <horikyota.ntt@gmail.com>
@ 2020-04-02 02:31 ` Edson Richter <edsonrichter@hotmail.com>
0 siblings, 0 replies; 10+ messages in thread
From: Edson Richter @ 2020-04-02 02:31 UTC (permalink / raw)
To: Kyotaro Horiguchi <horikyota.ntt@gmail.com>; david@pgmasters.net <david@pgmasters.net>; +Cc: pgsql-general; alvherre@2ndquadrant.com <alvherre@2ndquadrant.com>
________________________________
De: Kyotaro Horiguchi <horikyota.ntt@gmail.com>
Enviado: quarta-feira, 1 de abril de 2020 22:22
Para: david@pgmasters.net <david@pgmasters.net>
Cc: edsonrichter@hotmail.com <edsonrichter@hotmail.com>; pgsql-general@postgresql.org <pgsql-general@postgresql.org>; alvherre@2ndquadrant.com <alvherre@2ndquadrant.com>
Assunto: Re: It is possible to force periodically switch xlog?
At Wed, 1 Apr 2020 21:09:20 -0400, David Steele <david@pgmasters.net> wrote in
> On 4/1/20 7:19 PM, Edson Richter wrote:
> > IIRC archive_timeout does precisely that.
> > I would assume that "archive_mode" must be "on" or "always" - but I do
> > have "archive_mode=off".
>
> I'm not sure what the point of switching the WAL segment would be with
> archive_mode=off.
>
> What are you trying to accomplish?
Also I'm a bit curious about that, but anyway archive_timeout works
even with archive_mode=off. The name looks being a bit off of its
substance.
regards.
--
Kyotaro Horiguchi
NTT Open Source Software Center
Good to know!
But meanwhile I've wrote a small bash script that executs pg_switch_xlog() and scheduled it in Crond.
Regards,
Edson
^ permalink raw reply [nested|flat] 10+ messages in thread
* RE: It is possible to force periodically switch xlog?
2020-04-01 22:06 It is possible to force periodically switch xlog? Edson Richter <edsonrichter@hotmail.com>
2020-04-01 22:11 ` Re: It is possible to force periodically switch xlog? Abdul Sayeed <abdulsayeed24@gmail.com>
2020-04-01 22:55 ` Re: It is possible to force periodically switch xlog? Alvaro Herrera <alvherre@2ndquadrant.com>
2020-04-01 23:19 ` RE: It is possible to force periodically switch xlog? Edson Richter <edsonrichter@hotmail.com>
2020-04-02 01:09 ` Re: It is possible to force periodically switch xlog? David Steele <david@pgmasters.net>
@ 2020-04-02 02:29 ` Edson Richter <edsonrichter@hotmail.com>
2020-04-02 02:38 ` Re: It is possible to force periodically switch xlog? Alvaro Herrera <alvherre@2ndquadrant.com>
1 sibling, 1 reply; 10+ messages in thread
From: Edson Richter @ 2020-04-02 02:29 UTC (permalink / raw)
To: pgsql-general
________________________________
De: David Steele <david@pgmasters.net>
Enviado: quarta-feira, 1 de abril de 2020 22:09
Para: Edson Richter <edsonrichter@hotmail.com>; pgsql-general <pgsql-general@postgresql.org>
Cc: Alvaro Herrera <alvherre@2ndquadrant.com>
Assunto: Re: It is possible to force periodically switch xlog?
On 4/1/20 7:19 PM, Edson Richter wrote:
>
> IIRC archive_timeout does precisely that.
>
> I would assume that "archive_mode" must be "on" or "always" - but I do
> have "archive_mode=off".
I'm not sure what the point of switching the WAL segment would be with
archive_mode=off.
What are you trying to accomplish?
Actually, I do have a stand by server I wish to update a bit more frequently in low traffic servers.
Regards,
Regards,
--
-David
david@pgmasters.net
^ permalink raw reply [nested|flat] 10+ messages in thread
* Re: It is possible to force periodically switch xlog?
2020-04-01 22:06 It is possible to force periodically switch xlog? Edson Richter <edsonrichter@hotmail.com>
2020-04-01 22:11 ` Re: It is possible to force periodically switch xlog? Abdul Sayeed <abdulsayeed24@gmail.com>
2020-04-01 22:55 ` Re: It is possible to force periodically switch xlog? Alvaro Herrera <alvherre@2ndquadrant.com>
2020-04-01 23:19 ` RE: It is possible to force periodically switch xlog? Edson Richter <edsonrichter@hotmail.com>
2020-04-02 01:09 ` Re: It is possible to force periodically switch xlog? David Steele <david@pgmasters.net>
2020-04-02 02:29 ` RE: It is possible to force periodically switch xlog? Edson Richter <edsonrichter@hotmail.com>
@ 2020-04-02 02:38 ` Alvaro Herrera <alvherre@2ndquadrant.com>
2020-04-02 03:16 ` RE: It is possible to force periodically switch xlog? Edson Richter <edsonrichter@hotmail.com>
0 siblings, 1 reply; 10+ messages in thread
From: Alvaro Herrera @ 2020-04-02 02:38 UTC (permalink / raw)
To: Edson Richter <edsonrichter@hotmail.com>; +Cc: pgsql-general
On 2020-Apr-02, Edson Richter wrote:
> Actually, I do have a stand by server I wish to update a bit more
> frequently in low traffic servers.
It is better to use streaming replication for that. Using the WAL
archive for that is an archaic mechanism now.
--
Álvaro Herrera https://www.2ndQuadrant.com/
PostgreSQL Development, 24x7 Support, Remote DBA, Training & Services
^ permalink raw reply [nested|flat] 10+ messages in thread
* RE: It is possible to force periodically switch xlog?
2020-04-01 22:06 It is possible to force periodically switch xlog? Edson Richter <edsonrichter@hotmail.com>
2020-04-01 22:11 ` Re: It is possible to force periodically switch xlog? Abdul Sayeed <abdulsayeed24@gmail.com>
2020-04-01 22:55 ` Re: It is possible to force periodically switch xlog? Alvaro Herrera <alvherre@2ndquadrant.com>
2020-04-01 23:19 ` RE: It is possible to force periodically switch xlog? Edson Richter <edsonrichter@hotmail.com>
2020-04-02 01:09 ` Re: It is possible to force periodically switch xlog? David Steele <david@pgmasters.net>
2020-04-02 02:29 ` RE: It is possible to force periodically switch xlog? Edson Richter <edsonrichter@hotmail.com>
2020-04-02 02:38 ` Re: It is possible to force periodically switch xlog? Alvaro Herrera <alvherre@2ndquadrant.com>
@ 2020-04-02 03:16 ` Edson Richter <edsonrichter@hotmail.com>
0 siblings, 0 replies; 10+ messages in thread
From: Edson Richter @ 2020-04-02 03:16 UTC (permalink / raw)
To: Alvaro Herrera <alvherre@2ndquadrant.com>; +Cc: pgsql-general
________________________________
De: Alvaro Herrera <alvherre@2ndquadrant.com>
Enviado: quarta-feira, 1 de abril de 2020 23:38
Para: Edson Richter <edsonrichter@hotmail.com>
Cc: pgsql-general <pgsql-general@postgresql.org>
Assunto: Re: It is possible to force periodically switch xlog?
On 2020-Apr-02, Edson Richter wrote:
> Actually, I do have a stand by server I wish to update a bit more
> frequently in low traffic servers.
It is better to use streaming replication for that. Using the WAL
archive for that is an archaic mechanism now.
--
Álvaro Herrera https://nam10.safelinks.protection.outlook.com/?url=https%3A%2F%2Fwww.2ndQuadrant.com%2F&dat...
PostgreSQL Development, 24x7 Support, Remote DBA, Training & Services
Actually, I do use streaming 🙂
Our scenario is a bit more complex than ordinay wal archive or streaming.
With this setup we are able to backup 1.5 TB of data in less than 12 hours even with geographically distributted servers, and we have production.
1) We do have streaming from production to report server (geographically distributted)
2) Wal archive is setup from standby server to backup server (same location)
3) From time-to-time, we do barman backups from standby server (same location)
4) Twice a week, we restore every single database in a backup server to test backups.
Besides non standard, this setup is working really well for our needs.
But not everthing is shine like gold, and sometimes, for low traffic servers, barman complains not all wal segments were received.
Then we need to manually execute pg_switch_xlog at master, and after a "barman check-database" at backup server: this is what we would like to automate.
And it went well with a bash script and cron. At least, for 40 databases it is working really well.
Regards,
Edson
^ permalink raw reply [nested|flat] 10+ messages in thread
end of thread, other threads:[~2020-04-02 03:16 UTC | newest]
Thread overview: 10+ messages (download: mbox mbox.gz follow: Atom feed)
-- links below jump to the message on this page --
2020-04-01 22:06 It is possible to force periodically switch xlog? Edson Richter <edsonrichter@hotmail.com>
2020-04-01 22:11 ` Abdul Sayeed <abdulsayeed24@gmail.com>
2020-04-01 22:55 ` Alvaro Herrera <alvherre@2ndquadrant.com>
2020-04-01 23:19 ` Edson Richter <edsonrichter@hotmail.com>
2020-04-02 01:09 ` David Steele <david@pgmasters.net>
2020-04-02 01:22 ` Kyotaro Horiguchi <horikyota.ntt@gmail.com>
2020-04-02 02:31 ` Edson Richter <edsonrichter@hotmail.com>
2020-04-02 02:29 ` Edson Richter <edsonrichter@hotmail.com>
2020-04-02 02:38 ` Alvaro Herrera <alvherre@2ndquadrant.com>
2020-04-02 03:16 ` Edson Richter <edsonrichter@hotmail.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