fastdfs icon indicating copy to clipboard operation
fastdfs copied to clipboard

Bug Report: storage_sync.c函数storage_binlog_write_ex错误处理问题

Open giantpoplar opened this issue 4 years ago • 4 comments
trafficstars

在storage_binlog_write_ex中:

...... if ((result=pthread_mutex_lock(&sync_thread_lock)) != 0) { logError("file: "FILE", line: %d, "
"call pthread_mutex_lock fail, "
"errno: %d, error info: %s",
LINE, result, STRERROR(result)); } ......

这里lock出错后,依然继续往下处理,这个是有点问题的吧?我们在做高并发删除的时候,fastdfs生成了下面的binlog,有1行文件名为空,然后sync线程scan到这一行也进行不下去了

...... 1632325133 D M05/7D/61/CgI4e1x2DRaAW2p9AAABkZO6WB0987.xml 1632325133 D M04/4D/09/CgI4e1u02YSAI9zfAAABkbzo4K8546.xml 1632325133 D 1632325133 D M03/59/C6/CgI4e1u1kIaAUfFWAAAfZyKjO1M782.xml 1632325133 D M0A/F8/65/CgI4el2vLk6AcgNDAAAWLPouIAM000.xml ......

giantpoplar avatar Oct 08 '21 09:10 giantpoplar

删除掉有问题的binlog内容即可

happyfish100 avatar Oct 12 '21 23:10 happyfish100

很奇怪为啥会出现不完整的binlog记录。麻烦告知使用的 FastDFS版本

happyfish100 avatar Oct 12 '21 23:10 happyfish100

5.07。场景是我们在测试环境大量删除过期的文件索引,删除时会调用一下FDFS的文件Delete接口,但由于已经做过磁盘清理了(没有通过接口),所以大量删除都是不存在的文件。除了出现上述问题,进程运行了一会儿会大量报errno: 9,bad file descriptor,然后会异常退出。我发现这种情况下删除的速度也不快。

giantpoplar avatar Oct 14 '21 02:10 giantpoplar

建议升级到最新的 V6.07

happyfish100 avatar Oct 14 '21 12:10 happyfish100