Thread: archive file "00000001000000000000006F" has wrong size: 67118648 instead of 16777216

Hi,

WAL log recovery was failed on wrong log record size. Could you please advise me what is wrong in the setting ? Any suggestions will be highly appreciated.

Thanks,
Kiyoshi

postgres.conf:
wal_level = replica
archive_mode = on
archive_command = 'copy "%p" "D:\\BKUP\\pg_archivedir\\PostgreSQL_DEV\\%f"'

recover.conf:
restore_command = 'copy "D:\\BKUP\\pg_archivedir\\PostgreSQL_DEV" "%p"'

C:\Users\tkgsys>pg_ctl -D D:\PostgreSQL_RCV start
サーバの起動完了を待っています....2020-11-25 10:12:22.330 JST [7572] LOG:  listening on IPv6 address "::", port 5434
2020-11-25 10:12:22.331 JST [7572] LOG:  listening on IPv4 address "0.0.0.0", port 5434
2020-11-25 10:12:22.393 JST [7792] LOG:  database system was interrupted; last known up at 2020-11-24 11:01:00 JST
2020-11-25 10:12:22.858 JST [7792] LOG:  starting archive recovery
D:\BKUP\pg_archivedir\PostgreSQL_DEV\000000010000000000000056.00000028.backup
D:\BKUP\pg_archivedir\PostgreSQL_DEV\00000001000000000000005A.00000028.backup
D:\BKUP\pg_archivedir\PostgreSQL_DEV\00000001000000000000005D.00000028.backup
D:\BKUP\pg_archivedir\PostgreSQL_DEV\000000010000000000000060.00000060.backup
D:\BKUP\pg_archivedir\PostgreSQL_DEV\000000010000000000000064.00000060.backup
D:\BKUP\pg_archivedir\PostgreSQL_DEV\000000010000000000000068.00000028.backup
D:\BKUP\pg_archivedir\PostgreSQL_DEV\00000001000000000000006B
D:\BKUP\pg_archivedir\PostgreSQL_DEV\00000001000000000000006B.00000060.backup
D:\BKUP\pg_archivedir\PostgreSQL_DEV\00000001000000000000006C
D:\BKUP\pg_archivedir\PostgreSQL_DEV\00000001000000000000006D
D:\BKUP\pg_archivedir\PostgreSQL_DEV\00000001000000000000006E
.D:\BKUP\pg_archivedir\PostgreSQL_DEV\00000001000000000000006F
D:\BKUP\pg_archivedir\PostgreSQL_DEV\00000001000000000000006F.00000060.backup
D:\BKUP\pg_archivedir\PostgreSQL_DEV\000000010000000000000070
        1 個のファイルをコピーしました。
2020-11-25 10:12:23.569 JST [7792] FATAL:  archive file "00000001000000000000006F" has wrong size: 67118648 instead of 16777216
2020-11-25 10:12:23.571 JST [7572] LOG:  startup process (PID 7792) exited with exit code 1
2020-11-25 10:12:23.572 JST [7572] LOG:  aborting startup due to startup process failure
2020-11-25 10:12:23.576 JST [7572] LOG:  database system is shut down
 待機処理が停止されました
pg_ctl: サーバを起動できませんでした。
ログ出力を確認してください。

C:\Users\tkgsys>
On Wed, Nov 25, 2020 at 11:01:37AM +0900, 江川潔 wrote:
> Hi,
>
> WAL log recovery was failed on wrong log record size. Could you please
> advise me what is wrong in the setting ? Any suggestions will be highly
> appreciated.


> 2020-11-25 10:12:23.569 JST [7792] FATAL:  archive file
> "00000001000000000000006F" has wrong size: 67118648 instead of 16777216

Something is fishy with your WAL archive partition, so you had better
check its state, by for example using pg_waldump on each segment
archived.  This error means that the file copied was basically 64MB in
size, while these are expected to be 16MB in this instance.
--
Michael

Attachment
On Wed, Nov 25, 2020 at 3:02 AM 江川潔 <egawa@apteq.jp> wrote:
>
> Hi,
>
> WAL log recovery was failed on wrong log record size. Could you please advise me what is wrong in the setting ? Any
suggestionswill be highly appreciated. 
>
> Thanks,
> Kiyoshi
>
> postgres.conf:
> wal_level = replica
> archive_mode = on
> archive_command = 'copy "%p" "D:\\BKUP\\pg_archivedir\\PostgreSQL_DEV\\%f"'
>
> recover.conf:
> restore_command = 'copy "D:\\BKUP\\pg_archivedir\\PostgreSQL_DEV" "%p"'

Does your restore command really not have a %f in it anywhere? That
definitely seems wrong... But it does seem to copy some files correct,
which would be weird if it doesn't. Mistake in the report, or is there
something really weird going on with that PostgreSQL_DEV not being a
directory but instead some "magic file"?

--
 Magnus Hagander
 Me: https://www.hagander.net/
 Work: https://www.redpill-linpro.com/



Hi
I have corrected it on "restore_command = 'copy "D:\\BKUP\\pg_archivedir\\PostgreSQL_DEV\\%f" "%p"'".
Thanks,
Kiyoshi

2020年11月25日(水) 19:35 Magnus Hagander <magnus@hagander.net>:
On Wed, Nov 25, 2020 at 3:02 AM 江川潔 <egawa@apteq.jp> wrote:
>
> Hi,
>
> WAL log recovery was failed on wrong log record size. Could you please advise me what is wrong in the setting ? Any suggestions will be highly appreciated.
>
> Thanks,
> Kiyoshi
>
> postgres.conf:
> wal_level = replica
> archive_mode = on
> archive_command = 'copy "%p" "D:\\BKUP\\pg_archivedir\\PostgreSQL_DEV\\%f"'
>
> recover.conf:
> restore_command = 'copy "D:\\BKUP\\pg_archivedir\\PostgreSQL_DEV" "%p"'

Does your restore command really not have a %f in it anywhere? That
definitely seems wrong... But it does seem to copy some files correct,
which would be weird if it doesn't. Mistake in the report, or is there
something really weird going on with that PostgreSQL_DEV not being a
directory but instead some "magic file"?

--
 Magnus Hagander
 Me: https://www.hagander.net/
 Work: https://www.redpill-linpro.com/