sorintlab / stolon

PostgreSQL cloud native High Availability and more.
https://talk.stolon.io
Apache License 2.0
4.64k stars 444 forks source link

warnings related to WAL file size in Stolon Keeper logs #771

Open CanfengChen92 opened 4 years ago

CanfengChen92 commented 4 years ago

What happened: a lot of warnings related to WAL file size in Stolon keeper logs. (Both master and standby) These warnings are spawning every few seconds.

2020-03-20T09:32:59.414Z WARN cmd/keeper.go:704 error getting older wal file {"error": "wal file has unsupported size: 2097152"} 2020-03-20T09:33:01.948Z WARN cmd/keeper.go:704 error getting older wal file {"error": "wal file has unsupported size: 2097152"} 2020-03-20T09:33:02.293Z INFO cmd/keeper.go:1395 our db requested role is master 2020-03-20T09:33:02.297Z INFO cmd/keeper.go:1423 already master 2020-03-20T09:33:02.311Z INFO cmd/keeper.go:1585 postgres parameters not changed 2020-03-20T09:33:02.311Z INFO cmd/keeper.go:1596 postgres hba entries not changed LOG: incomplete startup packet 2020-03-20T09:33:04.483Z WARN cmd/keeper.go:704 error getting older wal file {"error": "wal file has unsupported size: 2097152"} 2020-03-20T09:33:07.019Z WARN cmd/keeper.go:704 error getting older wal file {"error": "wal file has unsupported size: 2097152"} 2020-03-20T09:33:07.343Z INFO cmd/keeper.go:1395 our db requested role is master 2020-03-20T09:33:07.346Z INFO cmd/keeper.go:1423 already master 2020-03-20T09:33:07.360Z INFO cmd/keeper.go:1585 postgres parameters not changed 2020-03-20T09:33:07.360Z INFO cmd/keeper.go:1596 postgres hba entries not changed LOG: incomplete startup packet 2020-03-20T09:33:09.553Z WARN cmd/keeper.go:704 error getting older wal file {"error": "wal file has unsupported size: 2097152"} 2020-03-20T09:33:12.086Z WARN cmd/keeper.go:704 error getting older wal file {"error": "wal file has unsupported size: 2097152"}

What you expected to happen: No those warning logs appear

How to reproduce it (as minimally and precisely as possible): When deploying a new Stolon cluster with the default configuration.

Anything else we need to know?: Checked from the Stolon Keeper's data directory and found that some files(maybe WAL files) auto-generated when a new Stolon cluster deployed. Those files size match that the warnings log mentioned.

sh-4.2$ pwd /stolon-data/postgres/pg_xlog sh-4.2$ sh-4.2$ ls -l total 4096 -rw-------. 1 stolon stolon 2097152 Mar 20 09:32 000000010000000000000006 -rw-------. 1 stolon stolon 2097152 Mar 20 09:42 000000010000000000000007 drwx------. 2 stolon stolon 43 Mar 20 09:32 archive_status sh-4.2$

Environment: OKD 3.9

sgotti commented 4 years ago

@CanfengChen92 Have you changed the default wal size (16MiB) when compiling postgres or when creating a db (is the db restored with pitr?)? If so we currently only support the default wal size:

https://github.com/sorintlab/stolon/blob/f512d7efe7e99e5b0d6a44e3c4d8b9ded9c04ea2/internal/postgresql/utils.go#L34-L35

Feel free to submit a PR to improve this.

CanfengChen92 commented 4 years ago

@CanfengChen92 Have you changed the default wal size (16MiB) when compiling postgres or when creating a db (is the db restored with pitr?)? If so we currently only support the default wal size:

https://github.com/sorintlab/stolon/blob/f512d7efe7e99e5b0d6a44e3c4d8b9ded9c04ea2/internal/postgresql/utils.go#L34-L35

Feel free to submit a PR to improve this.

We didn't change the default the WAL size setting during the compiling or creating. The DB was created with an empty data directory. By the way, can we specify the WAL size during the creating? And what's the configuration item? I have tried to specify the "max_wal_size" and "min_wal_size" in "pgParameters", but it doesn't work.

sgotti commented 4 years ago

@CanfengChen92 are you using the provided example stolon images?

CanfengChen92 commented 4 years ago

@CanfengChen92 are you using the provided example stolon images?

No, we get the stolon v0.12.0 source code and build it by ourselves. Didn't change any configuration.

sgotti commented 4 years ago

No, we get the stolon v0.12.0 source code and build it by ourselves. Didn't change any configuration.

Then you probably installed a postgres compiled with a non default wal size. You should check how you installed postgres.

CanfengChen92 commented 4 years ago

No, we get the stolon v0.12.0 source code and build it by ourselves. Didn't change any configuration.

Then you probably installed a postgres compiled with a non default wal size. You should check how you installed postgres.

Ok. I will check the build process. Thanks.