V2EX = way to explore
V2EX 是一个关于分享和探索的地方
现在注册
已注册用户请  登录
oldsix2
V2EX  ›  PostgreSQL

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

  •  
  •   oldsix2 · 319 天前 · 1106 次点击
    这是一个创建于 319 天前的主题,其中的信息可能已经有所发展或是发生改变。

    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)
    

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

    6 条回复    2023-06-15 17:20:36 +08:00
    oldsix2
        1
    oldsix2  
    OP
       319 天前
    更新,是主节点 vacuum full tablename 之后,主节点回收了磁盘空间。从节点多了这个不明文件
    oldsix2
        2
    oldsix2  
    OP
       319 天前   ❤️ 1
    结案了,15.0 版本的 bug 。15.1 的 changelog 里修复了。

    https://www.postgresql.org/docs/15/release-15-1.html#id-1.11.6.7.5
    wingor2015
        3
    wingor2015  
       319 天前
    学习了
    dw2693734d
        4
    dw2693734d  
       319 天前
    还在用 14
    oldsix2
        5
    oldsix2  
    OP
       319 天前   ❤️ 1
    @wingor2015 互相学习

    @dw2693734d 刚好给你排个雷,嘿嘿
    wingor2015
        6
    wingor2015  
       317 天前
    我们还在用 9.6 。。。
    关于   ·   帮助文档   ·   博客   ·   API   ·   FAQ   ·   我们的愿景   ·   实用小工具   ·   1031 人在线   最高记录 6543   ·     Select Language
    创意工作者们的社区
    World is powered by solitude
    VERSION: 3.9.8.5 · 25ms · UTC 18:39 · PVG 02:39 · LAX 11:39 · JFK 14:39
    Developed with CodeLauncher
    ♥ Do have faith in what you're doing.