xfsdump发生warning的原因解析

发表于 2017-02-27   |   分类于 技术

在执行全体备份的过程中有机率出现以下三个warning,现对每个warning的原因做了分析:
Warning 1:

xfsdump: WARNING: could not open regular file ino 35684867 mode 0x00008180: Stale file handle: not dumped

原因:因为xfsdump工具无法读取该文件的内容,所以不对该文件进行备份,并发出警告。

多次测试发现该文件为pg_internal.init

...
xfsdump: WARNING: could not open regular file ino 136309716 mode 0x00008180: Stale file handle: not dumped ...

# find / -inum 136309716
/var/lib/pgsql/data/base/62378/pg_internal.init

...
xfsdump: WARNING: could not open regular file ino 1671720 mode 0x00008180: Stale file handle: not dumped ...

# find / -inum 1671720
/var/lib/pgsql/data/base/61914/pg_internal.init

pg_internal.init文件是postgresql进程初始化cache用的:

When the backend is started up in normal mode, we load an image of the appropriate relation descriptors, in internal format, from an initialization file in the data/base/... directory.

If the initialization file isn't there, then we create the relation descriptors using sequential scans and write 'em to the initialization file for use by subsequent backends.

如果不存在该文件,则顺序扫描并创建relation descriptors,之后写入该文件。如果该文件存在,则简单的load进内存,填充 relation descriptors。
所以该文件是否备份并不影响postgresql的运行,也就不会影响全体backup和restore的机能。

Warning 2:

xfsdump: WARNING: most recent level 0 dump was interrupted, but not resuming that dump since resume (-R) option not specified

原因:上一次备份时发生interrupted错误,本次备份就会出现这条warning,-R选项能恢复上一次中断的备份。
查看xfsdump的man手册可以发现以下描述:

A previously interrupted dump can be resumed by specifying the -R option. If the most recent dump at the specified level was interrupted, the new dump does not include files already dumped, unless they have changed since the interrupted dump.

现在实装是没有使用-R选项的,每次全体backup都是从头开始,所以可以忽略这条warning。

上一次备份被中断的例子:

xfsdump: NOTE: dump interrupted: 189 seconds elapsed: may resume later using -R option
xfsdump: Dump Summary:
xfsdump:   stream 0 /backup/single.dmp.tmp ERROR (operator error or resource exhaustion)
xfsdump: Dump Status: INTERRUPT

Warning 3:

xfsdump: WARNING: failed to get bulkstat information for inode 103777998

原因:当文件已经被选择为需要备份,但是在写入备份文件前文件被删除了,就会发生这个warning。这个warning不是致命的,只是表明备份前和备份时文件的不统一。
如果某些程序在运行过程中会删除清理一些文件的话就有可能发生这个warning。
由于我们的备份机能在备份过程中不会删除任何文件,如果发生这个warning应该是其他程序的正常行为导致的,所以该warning也可以被忽略。

发表新评论

© 2017 Powered by Typecho
苏ICP备15035969号-3