PostgreSQL 流复制 1 主 1 从集群,从节点多余一个不知道作用的文件 16539.1

332 天前
 oldsix2

PostgreSQL 流复制 1 主 1 从集群,从节点 database 目录大于 主节点 database 目录

1 、主节点

# 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

2 、从节点

# 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)

怎么排查呢?哪位大佬知道吗

1120 次点击
所在节点    PostgreSQL
6 条回复
oldsix2
332 天前
更新,是主节点 vacuum full tablename 之后,主节点回收了磁盘空间。从节点多了这个不明文件
oldsix2
332 天前
结案了,15.0 版本的 bug 。15.1 的 changelog 里修复了。

https://www.postgresql.org/docs/15/release-15-1.html#id-1.11.6.7.5
wingor2015
332 天前
学习了
dw2693734d
332 天前
还在用 14
oldsix2
332 天前
@wingor2015 互相学习

@dw2693734d 刚好给你排个雷,嘿嘿
wingor2015
330 天前
我们还在用 9.6 。。。

这是一个专为移动设备优化的页面(即为了让你能够在 Google 搜索结果里秒开这个页面),如果你希望参与 V2EX 社区的讨论,你可以继续到 V2EX 上打开本讨论主题的完整版本。

https://www.v2ex.com/t/948333

V2EX 是创意工作者们的社区,是一个分享自己正在做的有趣事物、交流想法,可以遇见新朋友甚至新机会的地方。

V2EX is a community of developers, designers and creative people.

© 2021 V2EX