
PostgreSQL 流复制 1 主 1 从集群,从节点 database 目录大于 主节点 database 目录
# du -h base/16525 3.0G base/16525 # ls -ahlS base/16525 | head -10 total 3.0G -rw------- 1 postgres postgres 1.0G Jun 13 13:25 16608 -rw------- 1 postgres postgres 1.0G Jun 13 13:25 16608.1 -rw------- 1 postgres postgres 514M Jun 13 13:29 16608.2 -rw------- 1 postgres postgres 429M Jun 13 13:25 16611 -rw------- 1 postgres postgres 6.0M Jun 13 13:23 17111 -rw------- 1 postgres postgres 808K Jun 13 11:29 16680 -rw------- 1 postgres postgres 664K Jun 13 13:45 16608_fsm -rw------- 1 postgres postgres 568K Jun 13 13:23 16619 -rw------- 1 postgres postgres 528K Jun 12 20:26 16779 # du -h base/16525/ 3.2G base/16525/ # ls -ahlS base/16525 | head -10 total 3.2G -rw------- 1 postgres postgres 1.0G Jun 13 13:25 16608 -rw------- 1 postgres postgres 1.0G Jun 13 13:25 16608.1 -rw------- 1 postgres postgres 514M Jun 13 13:34 16608.2 -rw------- 1 postgres postgres 429M Jun 13 13:25 16611 -rw------- 1 postgres postgres 257M Jun 9 14:22 16539.1 -rw------- 1 postgres postgres 6.0M Jun 13 13:16 17111 -rw------- 1 postgres postgres 808K Jun 13 11:29 16680 -rw------- 1 postgres postgres 664K Jun 13 13:34 16608_fsm -rw------- 1 postgres postgres 568K Jun 13 13:16 16619 肉眼看起来是从节点多了 16539.1 文件,257M ,所以从节点目录大于主节点 0.2G 。 ls | grep 16539 这个 oid ,只存在 16539.1 一个文件
ls -ahlS base/16525 | grep 16539 -rw------- 1 postgres postgres 257M Jun 9 14:22 16539.1 sql 也查不到
test=# SELECT relname FROM pg_class WHERE pg_relation_filepath(oid) = 'base/16525/16539'; relname --------- (0 rows) 怎么排查呢?哪位大佬知道吗
1 oldsix2 OP 更新,是主节点 vacuum full tablename 之后,主节点回收了磁盘空间。从节点多了这个不明文件 |
2 oldsix2 OP 结案了,15.0 版本的 bug 。15.1 的 changelog 里修复了。 https://www.postgresql.org/docs/15/release-15-1.html#id-1.11.6.7.5 |
3 wingor2015 2023-06-13 17:17:36 +08:00 学习了 |
4 dw2693734d 2023-06-13 17:32:23 +08:00 还在用 14 |
5 oldsix2 OP |
6 wingor2015 2023-06-15 17:20:36 +08:00 我们还在用 9.6 。。。 |