合 GreenPlum中的primary和mirror之间一直处于Not In Sync状态
Tags: 故障处理GreenPlumNot In Sync镜像同步
现象
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 | [gpadmin@mdw ~]$ gpstate -m 20231229:17:47:37:468672 gpstate:mdw:gpadmin-[INFO]:-Starting gpstate with args: -m 20231229:17:47:37:468672 gpstate:mdw:gpadmin-[INFO]:-local Greenplum Version: 'postgres (Greenplum Database) 6.23.1 build commit:2731a45ecb364317207c560730cf9e2cbf17d7e4 Open Source' 20231229:17:47:37:468672 gpstate:mdw:gpadmin-[INFO]:-master Greenplum Version: 'PostgreSQL 9.4.26 (Greenplum Database 6.23.1 build commit:2731a45ecb364317207c560730cf9e2cbf17d7e4 Open Source) on x86_64-unknown-linux-gnu, compiled by gcc (GCC) 6.4.0, 64-bit compiled on Feb 7 2023 22:54:40' 20231229:17:47:37:468672 gpstate:mdw:gpadmin-[INFO]:-Obtaining Segment details from master... 20231229:17:47:37:468672 gpstate:mdw:gpadmin-[INFO]:-------------------------------------------------------------- 20231229:17:47:37:468672 gpstate:mdw:gpadmin-[INFO]:--Current GPDB mirror list and status 20231229:17:47:37:468672 gpstate:mdw:gpadmin-[INFO]:--Type = Group 20231229:17:47:37:468672 gpstate:mdw:gpadmin-[INFO]:-------------------------------------------------------------- 20231229:17:47:37:468672 gpstate:mdw:gpadmin-[INFO]:- Mirror Datadir Port Status Data Status 20231229:17:47:37:468672 gpstate:mdw:gpadmin-[INFO]:- sdw2 /dbaup/opt/greenplum/data/mirror/gpseg0 7000 Passive Synchronized 20231229:17:47:37:468672 gpstate:mdw:gpadmin-[INFO]:- sdw2 /dbaup/opt/greenplum/data/mirror/gpseg1 7001 Passive Not In Sync 20231229:17:47:37:468672 gpstate:mdw:gpadmin-[INFO]:- sdw2 /dbaup/opt/greenplum/data/mirror/gpseg2 7002 Passive Not In Sync 20231229:17:47:37:468672 gpstate:mdw:gpadmin-[INFO]:- sdw2 /dbaup/opt/greenplum/data/mirror/gpseg3 7003 Passive Synchronized 20231229:17:47:37:468672 gpstate:mdw:gpadmin-[INFO]:- sdw3 /dbaup/opt/greenplum/data/mirror/gpseg4 7000 Passive Synchronized 20231229:17:47:37:468672 gpstate:mdw:gpadmin-[INFO]:- sdw3 /dbaup/opt/greenplum/data/mirror/gpseg5 7001 Passive Synchronized 20231229:17:47:37:468672 gpstate:mdw:gpadmin-[INFO]:- sdw3 /dbaup/opt/greenplum/data/mirror/gpseg6 7002 Passive Synchronized 20231229:17:47:37:468672 gpstate:mdw:gpadmin-[INFO]:- sdw3 /dbaup/opt/greenplum/data/mirror/gpseg7 7003 Passive Synchronized 20231229:17:47:37:468672 gpstate:mdw:gpadmin-[INFO]:- sdw1 /dbaup/opt/greenplum/data/mirror/gpseg8 7000 Passive Synchronized 20231229:17:47:37:468672 gpstate:mdw:gpadmin-[INFO]:- sdw1 /dbaup/opt/greenplum/data/mirror/gpseg9 7001 Passive Synchronized 20231229:17:47:37:468672 gpstate:mdw:gpadmin-[INFO]:- sdw1 /dbaup/opt/greenplum/data/mirror/gpseg10 7002 Passive Synchronized 20231229:17:47:37:468672 gpstate:mdw:gpadmin-[INFO]:- sdw1 /dbaup/opt/greenplum/data/mirror/gpseg11 7003 Passive Synchronized 20231229:17:47:37:468672 gpstate:mdw:gpadmin-[INFO]:-------------------------------------------------------------- [gpadmin@mdw ~]$ gpstate -e 20231229:17:48:17:485051 gpstate:mdw:gpadmin-[INFO]:-Starting gpstate with args: -e 20231229:17:48:17:485051 gpstate:mdw:gpadmin-[INFO]:-local Greenplum Version: 'postgres (Greenplum Database) 6.23.1 build commit:2731a45ecb364317207c560730cf9e2cbf17d7e4 Open Source' 20231229:17:48:17:485051 gpstate:mdw:gpadmin-[INFO]:-master Greenplum Version: 'PostgreSQL 9.4.26 (Greenplum Database 6.23.1 build commit:2731a45ecb364317207c560730cf9e2cbf17d7e4 Open Source) on x86_64-unknown-linux-gnu, compiled by gcc (GCC) 6.4.0, 64-bit compiled on Feb 7 2023 22:54:40' 20231229:17:48:17:485051 gpstate:mdw:gpadmin-[INFO]:-Obtaining Segment details from master... 20231229:17:48:17:485051 gpstate:mdw:gpadmin-[INFO]:-Gathering data from segments... 20231229:17:48:18:485051 gpstate:mdw:gpadmin-[INFO]:----------------------------------------------------- 20231229:17:48:18:485051 gpstate:mdw:gpadmin-[INFO]:-Segment Mirroring Status Report 20231229:17:48:19:485051 gpstate:mdw:gpadmin-[INFO]:----------------------------------------------------- 20231229:17:48:19:485051 gpstate:mdw:gpadmin-[INFO]:-Unsynchronized Segment Pairs 20231229:17:48:19:485051 gpstate:mdw:gpadmin-[INFO]:- Current Primary Port WAL sync remaining bytes Mirror Port 20231229:17:48:19:485051 gpstate:mdw:gpadmin-[INFO]:- sdw1 6001 623870910848 sdw2 7001 20231229:17:48:19:485051 gpstate:mdw:gpadmin-[INFO]:- sdw1 6002 656085874704 sdw2 7002 [gpadmin@mdw ~]$ gpstate -e 20231229:17:48:22:488177 gpstate:mdw:gpadmin-[INFO]:-Starting gpstate with args: -e 20231229:17:48:22:488177 gpstate:mdw:gpadmin-[INFO]:-local Greenplum Version: 'postgres (Greenplum Database) 6.23.1 build commit:2731a45ecb364317207c560730cf9e2cbf17d7e4 Open Source' 20231229:17:48:22:488177 gpstate:mdw:gpadmin-[INFO]:-master Greenplum Version: 'PostgreSQL 9.4.26 (Greenplum Database 6.23.1 build commit:2731a45ecb364317207c560730cf9e2cbf17d7e4 Open Source) on x86_64-unknown-linux-gnu, compiled by gcc (GCC) 6.4.0, 64-bit compiled on Feb 7 2023 22:54:40' 20231229:17:48:22:488177 gpstate:mdw:gpadmin-[INFO]:-Obtaining Segment details from master... 20231229:17:48:22:488177 gpstate:mdw:gpadmin-[INFO]:-Gathering data from segments... 20231229:17:48:23:488177 gpstate:mdw:gpadmin-[INFO]:----------------------------------------------------- 20231229:17:48:23:488177 gpstate:mdw:gpadmin-[INFO]:-Segment Mirroring Status Report 20231229:17:48:24:488177 gpstate:mdw:gpadmin-[INFO]:----------------------------------------------------- 20231229:17:48:24:488177 gpstate:mdw:gpadmin-[INFO]:-Unsynchronized Segment Pairs 20231229:17:48:24:488177 gpstate:mdw:gpadmin-[INFO]:- Current Primary Port WAL sync remaining bytes Mirror Port 20231229:17:48:24:488177 gpstate:mdw:gpadmin-[INFO]:- sdw1 6001 623688459664 sdw2 7001 20231229:17:48:24:488177 gpstate:mdw:gpadmin-[INFO]:- sdw1 6002 655917579296 sdw2 7002 [gpadmin@mdw ~]$ |
可以看到,有2个实例一直处于“ Not In Sync”状态,使用gpstate -e
可以看到,需要同步的wal日志还剩600G,还是相当的大。
分析
分析发现,sdw1的6002实例和6001实例的wal日志的确还有600G需要传输:
1 2 3 | [gpadmin@sdw1 gpseg2]$ cd /dbaup/opt/greenplum/data/primary/gpseg2/pg_xlog/ [gpadmin@sdw1 pg_xlog]$ du -sh . 610G . |