Estou tentando atualizar 9.5.5 para 12.3 usando pg_uprade, recebi o seguinte erro
Os tamanhos máximos de segmentos de relação pg_controldata antigos e novos são inválidos ou não correspondem
9.5.5
Blocos por segmento de grande relação: 8388608
12.3
Blocos por segmento de grande relação: 131072
8388608 blocos equivalem a 64 GB.
Eu recompilei a versão 12.3 usando as seguintes opções
./configure --prefix=/opt/pgsql/PostgreSQL-12 --with-segsize=64
saída pg_controldata 9.5.5
pg_control version number: 942
Catalog version number: 201510051
Database system identifier: 6307574991682851055
Database cluster state: shut down
pg_control last modified: Thu 01 Oct 2020 07:15:50 PM EDT
Latest checkpoint location: 2FB/7C000028
Prior checkpoint location: 2FB/78000098
Latest checkpoint's REDO location: 2FB/7C000028
Latest checkpoint's REDO WAL file: 00000001000002FB0000001F
Latest checkpoint's TimeLineID: 1
Latest checkpoint's PrevTimeLineID: 1
Latest checkpoint's full_page_writes: on
Latest checkpoint's NextXID: 0/130082037
Latest checkpoint's NextOID: 182620
Latest checkpoint's NextMultiXactId: 1
Latest checkpoint's NextMultiOffset: 0
Latest checkpoint's oldestXID: 1741
Latest checkpoint's oldestXID's DB: 1
Latest checkpoint's oldestActiveXID: 0
Latest checkpoint's oldestMultiXid: 1
Latest checkpoint's oldestMulti's DB: 1
Latest checkpoint's oldestCommitTsXid:0
Latest checkpoint's newestCommitTsXid:0
Time of latest checkpoint: Thu 01 Oct 2020 07:15:50 PM EDT
Fake LSN counter for unlogged rels: 0/1
Minimum recovery ending location: 0/0
Min recovery ending loc's timeline: 0
Backup start location: 0/0
Backup end location: 0/0
End-of-backup record required: no
wal_level setting: hot_standby
wal_log_hints setting: off
max_connections setting: 1000
max_worker_processes setting: 8
max_prepared_xacts setting: 0
max_locks_per_xact setting: 64
track_commit_timestamp setting: off
Maximum data alignment: 8
Database block size: 8192
Blocks per segment of large relation: 8388608
WAL block size: 8192
Bytes per WAL segment: 67108864
Maximum length of identifiers: 64
Maximum columns in an index: 32
Maximum size of a TOAST chunk: 1996
Size of a large-object chunk: 2048
Date/time type storage: 64-bit integers
Float4 argument passing: by value
Float8 argument passing: by value
Data page checksum version: 0
saída pg_controldata 12.3
pg_control version number: 942
Catalog version number: 201510051
Database system identifier: 6307574991682851055
Database cluster state: shut down
pg_control last modified: Thu 01 Oct 2020 07:15:50 PM EDT
Latest checkpoint location: 2FB/7C000028
Prior checkpoint location: 2FB/78000098
Latest checkpoint's REDO location: 2FB/7C000028
Latest checkpoint's REDO WAL file: 00000001000002FB0000001F
Latest checkpoint's TimeLineID: 1
Latest checkpoint's PrevTimeLineID: 1
Latest checkpoint's full_page_writes: on
Latest checkpoint's NextXID: 0/130082037
Latest checkpoint's NextOID: 182620
Latest checkpoint's NextMultiXactId: 1
Latest checkpoint's NextMultiOffset: 0
Latest checkpoint's oldestXID: 1741
Latest checkpoint's oldestXID's DB: 1
Latest checkpoint's oldestActiveXID: 0
Latest checkpoint's oldestMultiXid: 1
Latest checkpoint's oldestMulti's DB: 1
Latest checkpoint's oldestCommitTsXid:0
Latest checkpoint's newestCommitTsXid:0
Time of latest checkpoint: Thu 01 Oct 2020 07:15:50 PM EDT
Fake LSN counter for unlogged rels: 0/1
Minimum recovery ending location: 0/0
Min recovery ending loc's timeline: 0
Backup start location: 0/0
Backup end location: 0/0
End-of-backup record required: no
wal_level setting: hot_standby
wal_log_hints setting: off
max_connections setting: 1000
max_worker_processes setting: 8
max_prepared_xacts setting: 0
max_locks_per_xact setting: 64
track_commit_timestamp setting: off
Maximum data alignment: 8
Database block size: 8192
Blocks per segment of large relation: 8388608
WAL block size: 8192
Bytes per WAL segment: 67108864
Maximum length of identifiers: 64
Maximum columns in an index: 32
Maximum size of a TOAST chunk: 1996
Size of a large-object chunk: 2048
Date/time type storage: 64-bit integers
Float4 argument passing: by value
Float8 argument passing: by value
Data page checksum version: 0
E executei pg_upgrade novamente e obtive o mesmo erro acima. O que estou perdendo aqui?
Você parece ter postado a
pg_controldata
saída para o PostgreSQL 9.5 duas vezes.De qualquer forma, você terá que configurar o PostgreSQL v12 com um tamanho de segmento de tabela não padrão:
Além disso, durante
initdb
, você terá que especificar o tamanho do segmento WAL não padrão:Em seguida
pg_upgrade
, deve ser bem-sucedido (se a localidade etc. corresponder).Então, depois de vários testes, encontrei o problema. Se eu executar o configure --with-segsize=64 no RHEL 6.10, o tamanho do segmento não será definido para 64 GB, mas se eu executá-lo no RHEL 7.8, será. Parece um bug com o RHEL 6.10.