7_PostgreSQL full_page_writes特性解析及测试
内容概述
在PG数据库中full_page_writes特性指在数据库检查点(checkpoint)之后,pg会在第一次变更每一个page时,将整个page的信息记录到wal文件中。为了解决在OS crash时page的写入操作可能存在partially completed的情况,即造成一个page中包括部分老数据和新数据混合的情况。WAL文件中只有行级变更信息,无法完成数据库恢复(crash recovery),所以引入full_page_writes特性,使用WAL文件中整个PAGE的信息完成数据库恢复,缺点时存储IO消耗较大,本文主要对该特性进行测试,方便大家加深印象及理解。测试结果如下: 场景一、关闭full_page_writes特性,破坏page前半部分,数据库无法启动。 场景二、开启full_page_writes特性,破坏page前半部分,数据库正常启动,数据一致。 场景三、关闭full_page_writes特性,破坏page后半部分,数据库正常启动,存在数据丢失,数据不一致,在crash recovery时对磁盘中原page的完整性检查不足。
关闭full_page_writes特性,破坏page前半部分
参数修改
postgres=# show full_page_writes ; full_page_writes ------------------ on (1 row) postgres=# alter system set full_page_writes=off; ALTER SYSTEM postgres=# show full_page_writes ; full_page_writes ------------------ on (1 row) postgres=# SELECT pg_reload_conf(); 2022-10-26 21:15:17.047 CST [9525] LOG: received SIGHUP, reloading configuration files 2022-10-26 21:15:17.047 CST [9525] LOG: parameter "full_page_writes" changed to "off" pg_reload_conf ---------------- t (1 row) postgres=# show full_page_writes ; full_page_writes ------------------ off (1 row) postgres=#
异常模拟
### step1. 创建table t1切换日志并查询当前日志
drop table t1;
create table t1(a1 varchar);
select pg_switch_wal();
insert into t1 values('11111111');
checkpoint;
SELECT pg_walfile_name(pg_current_wal_lsn());
postgres=# SELECT pg_walfile_name(pg_current_wal_lsn());
pg_walfile_name
--------------------------
000000010000000000000002
(1 row)
postgres=#
### step2. 查询表的路径
select pg_relation_filepath('t1');
postgres=# select pg_relation_filepath('t1');
pg_relation_filepath
----------------------
base/5/16384
(1 row)
postgres=#
### step3. 插入一条记录,并生成新的日志文件
select pg_switch_wal();
SELECT pg_walfile_name(pg_current_wal_lsn());
postgres=# SELECT pg_walfile_name(pg_current_wal_lsn());
pg_walfile_name
--------------------------
000000010000000000000003
(1 row)
postgres=#
insert into t1 values(22222222);
### stop4. 关闭数据库
[postgres@enmo pgwal]$ pg_ctl stop -m immediate
### step5. 检查数据文件中信息
[postgres@enmo pgwal]$ ls -ltr $PGDATA/base/5/16384
-rw------- 1 postgres dba 8192 Oct 26 21:39 /u01/pg15/pgdata/base/5/16384
[postgres@enmo pg15]$ dd if=$PGDATA/base/5/16384 bs=8192 skip=0 count=1 |hexdump -C
1+0 records in
1+0 records out
8192 bytes (8.2 kB) copied, 2.96e-05 s, 277 MB/s
00000000 00 00 00 00 68 00 00 02 00 00 00 00 1c 00 d8 1f |....h...........|
00000010 00 20 04 20 00 00 00 00 d8 9f 42 00 00 00 00 00 |. . ......B.....|
00000020 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 |................|
*
00001fd0 00 00 00 00 00 00 00 00 d5 02 00 00 00 00 00 00 |................|
00001fe0 00 00 00 00 00 00 00 00 01 00 01 00 02 08 18 00 |................|
00001ff0 13 31 31 31 31 31 31 31 31 00 00 00 00 00 00 00 |.11111111.......| <--数据文件中只有“11111111”
00002000
[postgres@enmo pg15]$
### step6. 检查日志文件中信息
[postgres@enmo pg15]$ dd if=$PGDATA/pg_wal/000000010000000000000003 bs=8192 skip=0 count=1 |hexdump -C
1+0 records in
1+0 records out
8192 bytes (8.2 kB) copied, 3.6352e-05 s, 225 MB/s
00000000 10 d1 06 00 01 00 00 00 00 00 00 03 00 00 00 00 |................|
00000010 00 00 00 00 00 00 00 00 36 a6 32 24 66 3a 59 63 |........6.2$f:Yc|
00000020 00 00 00 01 00 20 00 00 32 00 00 00 00 00 00 00 |..... ..2.......|
00000030 50 b2 01 02 00 00 00 00 10 08 00 00 24 7e 48 a5 |P...........$~H.|
00000040 ff 18 00 00 00 00 00 00 00 00 00 f3 95 bf e1 02 |................|
00000050 00 00 e1 02 00 00 e0 02 00 00 00 00 00 00 00 00 |................|
00000060 40 00 00 00 e1 02 00 00 28 00 00 03 00 00 00 00 |@.......(.......|
00000070 00 0a 00 00 dc 3c b3 1d 00 20 0f 00 7f 06 00 00 |.....<... ......|
00000080 05 00 00 00 00 40 00 00 00 00 00 00 ff 03 01 00 |.....@..........|
00000090 02 08 18 00 13 32 32 32 32 32 32 32 32 02 00 00 |.....22222222...| <--WAL文件中只有“22222222”
000000a0 22 00 00 00 e1 02 00 00 60 00 00 03 00 00 00 00 |".......`.......|
000000b0 00 01 00 00 06 89 b3 07 ff 08 53 61 b6 17 ef 8e |..........Sa....|
000000c0 02 00 00 00 00 00 00 00 32 00 00 00 00 00 00 00 |........2.......|
000000d0 a0 00 00 03 00 00 00 00 10 08 00 00 34 1b 26 29 |............4.&)|
000000e0 ff 18 00 00 00 00 00 00 00 00 00 f3 95 bf e2 02 |................|
000000f0 00 00 e2 02 00 00 e1 02 00 00 00 00 00 00 00 00 |................|
00000100 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 |................|
*
00002000
[postgres@enmo pg15]$
### step7. partially破坏page
[postgres@enmo pgwal]$ dd if=/dev/zero of=$PGDATA/base/5/16384 bs=512 skip=0 seek=0 count=8 conv=notrunc
8+0 records in
8+0 records out
4096 bytes (4.1 kB) copied, 4.9061e-05 s, 83.5 MB/s
[postgres@enmo pgwal]$
### step8. 再次检查数据文件中信息
[postgres@enmo pg15]$ dd if=$PGDATA/base/5/16384 bs=8192 skip=0 count=1 |hexdump -C
1+0 records in
1+0 records out
8192 bytes (8.2 kB) copied, 3.7833e-05 s, 217 MB/s
00000000 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 |................|
*
00001fd0 00 00 00 00 00 00 00 00 d5 02 00 00 00 00 00 00 |................|
00001fe0 00 00 00 00 00 00 00 00 01 00 01 00 02 08 18 00 |................|
00001ff0 13 31 31 31 31 31 31 31 31 00 00 00 00 00 00 00 |.11111111.......|
00002000
[postgres@enmo pg15]$
### step 9. 启动数据库
[postgres@enmo pg15]$ pg_ctl start
waiting for server to start....2022-10-26 22:01:33.303 CST [9910] LOG: starting PostgreSQL 15beta1 on x86_64-pc-linux-gnu, compiled by gcc (GCC) 4.8.5 20150623 (Red Hat 4.8.5-28), 64-bit
2022-10-26 22:01:33.303 CST [9910] LOG: listening on IPv6 address "::1", port 5432
2022-10-26 22:01:33.303 CST [9910] LOG: listening on IPv4 address "127.0.0.1", port 5432
2022-10-26 22:01:33.304 CST [9910] LOG: listening on Unix socket "/tmp/.s.PGSQL.5432"
2022-10-26 22:01:33.307 CST [9913] LOG: database system was interrupted; last known up at 2022-10-26 21:59:29 CST
2022-10-26 22:01:33.312 CST [9913] LOG: database system was not properly shut down; automatic recovery in progress
2022-10-26 22:01:33.313 CST [9913] LOG: redo starts at 0/20000C8
2022-10-26 22:01:33.314 CST [9913] FATAL: invalid page in block 0 of relation base/5/16384
2022-10-26 22:01:33.314 CST [9913] CONTEXT: WAL redo at 0/3000060 for Heap/INSERT: off 2 flags 0x00; blkref #0: rel 1663/5/16384, blk 0
2022-10-26 22:01:33.314 CST [9910] LOG: startup process (PID 9913) exited with exit code 1
2022-10-26 22:01:33.314 CST [9910] LOG: terminating any other active server processes
2022-10-26 22:01:33.315 CST [9910] LOG: shutting down due to startup process failure
2022-10-26 22:01:33.316 CST [9910] LOG: database system is shut down
stopped waiting
pg_ctl: could not start server
Examine the log output.
[postgres@enmo pg15]$
开启full_page_writes特性,破坏page前半部分
参数修改
postgres=# show full_page_writes ; full_page_writes ------------------ on (1 row)
异常模拟
### step1. 创建table t1切换日志并查询当前日志
drop table t1;
create table t1(a1 varchar);
select pg_switch_wal();
insert into t1 values('11111111');
checkpoint;
SELECT pg_walfile_name(pg_current_wal_lsn());
postgres=# SELECT pg_walfile_name(pg_current_wal_lsn());
pg_walfile_name
--------------------------
000000010000000000000002
(1 row)
postgres=#
### step2. 查询表的路径
select pg_relation_filepath('t1');
postgres=# select pg_relation_filepath('t1');
pg_relation_filepath
----------------------
base/5/16384
(1 row)
postgres=#
### step3. 插入一条记录,并生成新的日志文件
select pg_switch_wal();
SELECT pg_walfile_name(pg_current_wal_lsn());
postgres=# SELECT pg_walfile_name(pg_current_wal_lsn());
pg_walfile_name
--------------------------
000000010000000000000003
(1 row)
postgres=#
insert into t1 values(22222222);
### stop4. 关闭数据库
[postgres@enmo pgwal]$ pg_ctl stop -m immediate
### step5. 检查数据文件中信息
[postgres@enmo pgwal]$ ls -ltr $PGDATA/base/5/16384
-rw------- 1 postgres dba 8192 Oct 26 21:39 /u01/pg15/pgdata/base/5/16384
[postgres@enmo pg15]$ dd if=$PGDATA/base/5/16384 bs=8192 skip=0 count=1 |hexdump -C
1+0 records in
1+0 records out
8192 bytes (8.2 kB) copied, 2.96e-05 s, 277 MB/s
00000000 00 00 00 00 68 00 00 02 00 00 00 00 1c 00 d8 1f |....h...........|
00000010 00 20 04 20 00 00 00 00 d8 9f 42 00 00 00 00 00 |. . ......B.....|
00000020 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 |................|
*
00001fd0 00 00 00 00 00 00 00 00 d5 02 00 00 00 00 00 00 |................|
00001fe0 00 00 00 00 00 00 00 00 01 00 01 00 02 08 18 00 |................|
00001ff0 13 31 31 31 31 31 31 31 31 00 00 00 00 00 00 00 |.11111111.......| <--数据文件中只有“11111111”
00002000
[postgres@enmo pg15]$
### step6. 检查日志文件中信息
[postgres@enmo pg15]$ dd if=$PGDATA/pg_wal/000000010000000000000003 bs=8192 skip=0 count=1 |hexdump -C
1+0 records in
1+0 records out
8192 bytes (8.2 kB) copied, 3.6999e-05 s, 221 MB/s
00000000 10 d1 06 00 01 00 00 00 00 00 00 03 00 00 00 00 |................|
00000010 00 00 00 00 00 00 00 00 c3 16 52 34 5f 3e 59 63 |..........R4_>Yc|
00000020 00 00 00 01 00 20 00 00 32 00 00 00 00 00 00 00 |..... ..2.......|
00000030 60 03 04 02 00 00 00 00 10 08 00 00 21 84 0d 52 |`...........!..R|
00000040 ff 18 00 00 00 00 00 00 00 00 00 63 e3 22 e1 02 |...........c."..|
00000050 00 00 e1 02 00 00 e0 02 00 00 00 00 00 00 00 00 |................|
00000060 a6 00 00 00 e1 02 00 00 28 00 00 03 00 00 00 00 |........(.......|
00000070 00 0a 00 00 1e 0a 02 de 00 10 00 00 70 00 20 00 |............p. .|
00000080 03 7f 06 00 00 05 00 00 00 00 40 00 00 00 00 00 |..........@.....|
00000090 00 ff 03 00 00 00 00 68 00 00 02 00 00 00 00 20 |.......h....... |
000000a0 00 b0 1f 00 20 04 20 00 00 00 00 d8 9f 42 00 b0 |.... . ......B..|
000000b0 9f 42 00 e1 02 00 00 00 00 00 00 00 00 00 00 00 |.B..............|
000000c0 00 00 00 02 00 01 00 02 08 18 00 13 32 32 32 32 |............2222| <<--有“11111111”
000000d0 32 32 32 32 00 00 00 00 00 00 00 d5 02 00 00 00 |2222............|
000000e0 00 00 00 00 00 00 00 00 00 00 00 01 00 01 00 02 |................|
000000f0 08 18 00 13 31 31 31 31 31 31 31 31 00 00 00 00 |....11111111....| <<--有"22222222"
00000100 00 00 00 02 00 00 00 00 22 00 00 00 e1 02 00 00 |........".......|
00000110 60 00 00 03 00 00 00 00 00 01 00 00 5f d9 e7 86 |`..........._...|
00000120 ff 08 fc f8 40 4c ef 8e 02 00 00 00 00 00 00 00 |....@L..........|
00000130 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 |................|
*
00002000
[postgres@enmo pg15]$
### step7. partially破坏page
[postgres@enmo pgwal]$ dd if=/dev/zero of=$PGDATA/base/5/16384 bs=512 skip=0 seek=0 count=8 conv=notrunc
8+0 records in
8+0 records out
4096 bytes (4.1 kB) copied, 4.9061e-05 s, 83.5 MB/s
[postgres@enmo pgwal]$
### step8. 再次检查数据文件中信息
[postgres@enmo pg15]$ dd if=$PGDATA/base/5/16384 bs=8192 skip=0 seek=0 count=1 |hexdump -C
1+0 records in
1+0 records out
8192 bytes (8.2 kB) copied, 3.7952e-05 s, 216 MB/s
00000000 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 |................|
*
00001fd0 00 00 00 00 00 00 00 00 d5 02 00 00 00 00 00 00 |................|
00001fe0 00 00 00 00 00 00 00 00 01 00 01 00 02 08 18 00 |................|
00001ff0 13 31 31 31 31 31 31 31 31 00 00 00 00 00 00 00 |.11111111.......|
00002000
[postgres@enmo pg15]$
### step 9. 启动数据库
[postgres@enmo pg15]$ pg_ctl start
waiting for server to start....2022-10-26 22:08:21.333 CST [9953] LOG: starting PostgreSQL 15beta1 on x86_64-pc-linux-gnu, compiled by gcc (GCC) 4.8.5 20150623 (Red Hat 4.8.5-28), 64-bit
2022-10-26 22:08:21.334 CST [9953] LOG: listening on IPv6 address "::1", port 5432
2022-10-26 22:08:21.334 CST [9953] LOG: listening on IPv4 address "127.0.0.1", port 5432
2022-10-26 22:08:21.334 CST [9953] LOG: listening on Unix socket "/tmp/.s.PGSQL.5432"
2022-10-26 22:08:21.336 CST [9956] LOG: database system was interrupted; last known up at 2022-10-26 22:05:42 CST
2022-10-26 22:08:21.342 CST [9956] LOG: database system was not properly shut down; automatic recovery in progress
2022-10-26 22:08:21.343 CST [9956] LOG: redo starts at 0/2000090
2022-10-26 22:08:21.344 CST [9956] LOG: invalid record length at 0/3000130: wanted 24, got 0
2022-10-26 22:08:21.344 CST [9956] LOG: redo done at 0/3000108 system usage: CPU: user: 0.00 s, system: 0.00 s, elapsed: 0.00 s
2022-10-26 22:08:21.345 CST [9954] LOG: checkpoint starting: end-of-recovery immediate wait
2022-10-26 22:08:21.348 CST [9954] LOG: checkpoint complete: wrote 43 buffers (0.3%); 0 WAL file(s) added, 0 removed, 1 recycled; write=0.002 s, sync=0.001 s, total=0.004 s; sync files=12, longest=0.001 s, average=0.001 s; distance=16384 kB, estimate=16384 kB
2022-10-26 22:08:21.349 CST [9953] LOG: database system is ready to accept connections
done
server started
[postgres@enmo pg15]$
### step 10. 检查数据一致性
[postgres@enmo pg15]$ psql
psql (15beta1)
Type "help" for help.
postgres=# select * from t1;
a1
----------
11111111
22222222
(2 rows)
postgres=#
关闭full_page_writes特性,破坏page后半部分
参数修改
[postgres@pgsql ~]$ psql psql (15.0) Type "help" for help. postgres=# show full_page_writes ; full_page_writes ------------------ on (1 row) postgres=# alter system set full_page_writes=off; ALTER SYSTEM postgres=# show full_page_writes ; full_page_writes ------------------ on (1 row) postgres=# SELECT pg_reload_conf(); pg_reload_conf ---------------- t (1 row) postgres=# show full_page_writes ; full_page_writes ------------------ off (1 row) postgres=#
异常模拟
### step1. 创建table t1切换日志并查询当前日志
drop table t1;
create table t1(a1 varchar);
select pg_switch_wal();
insert into t1 values('11111111');
checkpoint;
SELECT pg_walfile_name(pg_current_wal_lsn());
postgres=# SELECT pg_walfile_name(pg_current_wal_lsn());
pg_walfile_name
--------------------------
000000010000000000000002
(1 row)
postgres=#
### step2. 查询表的路径
select pg_relation_filepath('t1');
postgres=# select pg_relation_filepath('t1');
pg_relation_filepath
----------------------
base/5/16388
(1 row)
postgres=#
### step3. 插入一条记录,并生成新的日志文件
select pg_switch_wal();
SELECT pg_walfile_name(pg_current_wal_lsn());
postgres=# SELECT pg_walfile_name(pg_current_wal_lsn());
pg_walfile_name
--------------------------
000000010000000000000003
(1 row)
postgres=# insert into t1 values(22222222);
### stop4. 关闭数据库
[postgres@enmo pgwal]$ pg_ctl stop -m immediate
### step5. 检查数据文件中信息
[postgres@enmo pgwal]$ ls -ltr $PGDATA/base/5/16388
-rw------- 1 postgres dba 8192 Oct 26 21:39 /u01/pg15/pgdata/base/5/16388
[postgres@enmo pg15]$ dd if=$PGDATA/base/5/16388 bs=8192 skip=0 count=1 |hexdump -C
1+0 records in
1+0 records out
8192 bytes (8.2 kB) copied, 2.96e-05 s, 277 MB/s
00000000 00 00 00 00 68 00 00 02 00 00 00 00 1c 00 d8 1f |....h...........|
00000010 00 20 04 20 00 00 00 00 d8 9f 42 00 00 00 00 00 |. . ......B.....|
00000020 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 |................|
*
00001fd0 00 00 00 00 00 00 00 00 d5 02 00 00 00 00 00 00 |................|
00001fe0 00 00 00 00 00 00 00 00 01 00 01 00 02 08 18 00 |................|
00001ff0 13 31 31 31 31 31 31 31 31 00 00 00 00 00 00 00 |.11111111.......| <--数据文件中只有“11111111”
00002000
[postgres@enmo pg15]$
### step6. 检查日志文件中信息
[postgres@enmo pg15]$ dd if=$PGDATA/pg_wal/000000010000000000000003 bs=8192 skip=0 count=1 |hexdump -C
1+0 records in
1+0 records out
8192 bytes (8.2 kB) copied, 3.6352e-05 s, 225 MB/s
00000000 10 d1 06 00 01 00 00 00 00 00 00 03 00 00 00 00 |................|
00000010 00 00 00 00 00 00 00 00 36 a6 32 24 66 3a 59 63 |........6.2$f:Yc|
00000020 00 00 00 01 00 20 00 00 32 00 00 00 00 00 00 00 |..... ..2.......|
00000030 50 b2 01 02 00 00 00 00 10 08 00 00 24 7e 48 a5 |P...........$~H.|
00000040 ff 18 00 00 00 00 00 00 00 00 00 f3 95 bf e1 02 |................|
00000050 00 00 e1 02 00 00 e0 02 00 00 00 00 00 00 00 00 |................|
00000060 40 00 00 00 e1 02 00 00 28 00 00 03 00 00 00 00 |@.......(.......|
00000070 00 0a 00 00 dc 3c b3 1d 00 20 0f 00 7f 06 00 00 |.....<... ......|
00000080 05 00 00 00 00 40 00 00 00 00 00 00 ff 03 01 00 |.....@..........|
00000090 02 08 18 00 13 32 32 32 32 32 32 32 32 02 00 00 |.....22222222...| <--WAL文件中只有“22222222”
000000a0 22 00 00 00 e1 02 00 00 60 00 00 03 00 00 00 00 |".......`.......|
000000b0 00 01 00 00 06 89 b3 07 ff 08 53 61 b6 17 ef 8e |..........Sa....|
000000c0 02 00 00 00 00 00 00 00 32 00 00 00 00 00 00 00 |........2.......|
000000d0 a0 00 00 03 00 00 00 00 10 08 00 00 34 1b 26 29 |............4.&)|
000000e0 ff 18 00 00 00 00 00 00 00 00 00 f3 95 bf e2 02 |................|
000000f0 00 00 e2 02 00 00 e1 02 00 00 00 00 00 00 00 00 |................|
00000100 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 |................|
*
00002000
[postgres@enmo pg15]$
### step7. partially破坏page
[postgres@enmo pgwal]$ dd if=/dev/zero of=$PGDATA/base/5/16388 bs=512 skip=0 seek=8 count=8 conv=notrunc
8+0 records in
8+0 records out
4096 bytes (4.1 kB) copied, 4.9061e-05 s, 83.5 MB/s
[postgres@enmo pgwal]$
### step8. 再次检查数据文件中信息
[postgres@pgsql ~]$ dd if=$PGDATA/base/5/16388 bs=8192 skip=0 seek=0 count=1 |hexdump -C
1+0 records in
1+0 records out
8192 bytes (8.2 kB) copied, 3.7357e-05 s, 219 MB/s
00000000 00 00 00 00 68 00 00 02 00 00 00 00 1c 00 d8 1f |....h...........|
00000010 00 20 04 20 00 00 00 00 d8 9f 42 00 00 00 00 00 |. . ......B.....|
00000020 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 |................|
*
00002000
[postgres@pgsql ~]$
### step 9. 启动数据库
[postgres@pgsql ~]$ pg_ctl start
waiting for server to start....2022-10-27 06:25:22.026 CST [1684] LOG: starting PostgreSQL 15.0 on x86_64-pc-linux-gnu, compiled by gcc (GCC) 4.8.5 20150623 (Red Hat 4.8.5-28), 64-bit
2022-10-27 06:25:22.028 CST [1684] LOG: listening on IPv6 address "::1", port 5432
2022-10-27 06:25:22.028 CST [1684] LOG: listening on IPv4 address "127.0.0.1", port 5432
2022-10-27 06:25:22.029 CST [1684] LOG: listening on Unix socket "/tmp/.s.PGSQL.5432"
2022-10-27 06:25:22.031 CST [1687] LOG: database system was interrupted; last known up at 2022-10-27 06:15:33 CST
2022-10-27 06:25:22.037 CST [1687] LOG: database system was not properly shut down; automatic recovery in progress
2022-10-27 06:25:22.038 CST [1687] LOG: redo starts at 0/2000090
2022-10-27 06:25:22.038 CST [1687] LOG: invalid record length at 0/30000C8: wanted 24, got 0
2022-10-27 06:25:22.038 CST [1687] LOG: redo done at 0/30000A0 system usage: CPU: user: 0.00 s, system: 0.00 s, elapsed: 0.00 s
2022-10-27 06:25:22.039 CST [1685] LOG: checkpoint starting: end-of-recovery immediate wait
2022-10-27 06:25:22.041 CST [1685] LOG: checkpoint complete: wrote 4 buffers (0.0%); 0 WAL file(s) added, 0 removed, 1 recycled; write=0.001 s, sync=0.001 s, total=0.003 s; sync files=3, longest=0.001 s, average=0.001 s; distance=16384 kB, estimate=16384 kB
2022-10-27 06:25:22.042 CST [1684] LOG: database system is ready to accept connections
done
server started
[postgres@pgsql ~]$
### step 10. 检查数据一致性
[postgres@pgsql ~]$ psql
psql (15.0)
Type "help" for help.
postgres=# select * from t1;
a1
----------
22222222
(1 row)
postgres=#
最后修改时间:2022-10-31 08:53:08
「喜欢这篇文章,您的关注和赞赏是给作者最好的鼓励」
关注作者
【版权声明】本文为墨天轮用户原创内容,转载时必须标注文章的来源(墨天轮),文章链接,文章作者等基本信息,否则作者和墨天轮有权追究责任。如果您发现墨天轮中有涉嫌抄袭或者侵权的内容,欢迎发送邮件至:contact@modb.pro进行举报,并提供相关证据,一经查实,墨天轮将立刻删除相关内容。




