Chinaunix

标题: fastdfs 5.01 bug 中文更新问题 [打印本页]

作者: xcl3721    时间: 2014-04-23 16:17
标题: fastdfs 5.01 bug 中文更新问题
本帖最后由 xcl3721 于 2014-04-23 16:38 编辑

首先使用php client

$storage = fastdfs_tracker_query_storage_store($group_name);
   
fastdfs_storage_upload_appender_by_filebuff(“测试提交 @xcl3721 @sd^&*$#@^&(*%!(#dd@s我了个dkjkfd @_fds4444jlk”, $file_ext, $file_meta, $group_name, self:tracker, $storage);

然后更新内容为随意一个英文字符串

fastdfs_storage_modify_by_filebuff($content, 0, $group_name, $remote_filename, self:tracker, $storage);

然后读取
fastdfs_tracker_query_storage_fetch
fastdfs_storage_download_file_to_buff($group_name, $remote_filename, $file_offset, $file_range, self:tracker, $storage);

返回值为null
查看info以及existe都为正常

root@172-1-4-96 u8qyer]# tail -f /home/yuqing/fastdfs/logs/storaged.log
[2014-04-23 14:45:48] WARNING - file: storage_service.c, line: 4891, client ip: 172.1.4.96, appender file: /home/yuqing/fastdfs/data/00/06/rAEEYFNXWjaEEoyyAAAAANJEtCU056.txt not exist
[2014-04-23 14:45:48] WARNING - file: storage_service.c, line: 4891, client ip: 172.1.4.96, appender file: /home/yuqing/fastdfs/data/00/06/rAEEYFNXWjaEEoyyAAAAANJEtCU056.txt not exist
[2014-04-23 14:49:21] ERROR - file: storage_service.c, line: 4832, client ip: 172.1.4.96, in request pkg, file offset: -1 is invalid, which < 0
[2014-04-23 15:18:29] ERROR - file: trunk_mgr/trunk_shared.c, line: 271, filename: M00\/00\/15\/rAECZlNXaAiEehwdAAAAANyNRJc839.txt is invalid
[2014-04-23 15:41:44] WARNING - file: storage_service.c, line: 7363, client ip: 172.1.4.96, logic file: M00/00/06/rAEEYFNXWjaEEoyyAAAAANJEtCU056.txt not exist
[2014-04-23 15:43:34] WARNING - file: storage_service.c, line: 7363, client ip: 172.1.4.96, logic file: M00/00/06/rAEEYFNXWjaEEoyyAAAAANJEtCU056.txt not exist
[2014-04-23 15:47:31] WARNING - file: storage_service.c, line: 7363, client ip: 172.1.4.96, logic file: M00/00/06/rAEEYFNXWjaEEoyyAAAAANJEtCU056.txt not exist
[2014-04-23 15:55:23] WARNING - file: storage_service.c, line: 6975, client ip: 172.1.4.96, logic file: M00/00/06/rAEEYFNXccmENrEaAAAAANJEtCU401.txt not exist
[2014-04-23 15:55:28] WARNING - file: storage_service.c, line: 4891, client ip: 172.1.4.96, appender file: /home/yuqing/fastdfs/data/00/06/rAEEYFNXccmENrEaAAAAANJEtCU401.txt not exist
[2014-04-23 15:55:56] WARNING - file: storage_service.c, line: 4891, client ip: 172.1.4.96, appender file: /home/yuqing/fastdfs/data/00/06/rAEEYFNXccmENrEaAAAAANJEtCU401.txt not exist

注意哦,上面的文件不存在和这个测试文件无关

[root@172-1-4-96 u8qyer]# tail -f /home/yuqing/fastdfs/logs/trackerd.log
Input to decode not an even multiple of 4 characters; pad with .
Input to decode not an even multiple of 4 characters; pad with .
Input to decode not an even multiple of 4 characters; pad with .
Input to decode not an even multiple of 4 characters; pad with .
[2014-04-23 14:08:38] ERROR - file: tracker_mem.c, line: 5404, invalid group_name: group12
Input to decode not an even multiple of 4 characters; pad with .
Input to decode not an even multiple of 4 characters; pad with .
[2014-04-23 14:43:55] ERROR - file: tracker_service.c, line: 2277, cmd=102, client ip: 172.1.4.96, package size 17 is not correct, expect length > 38
Input to decode not an even multiple of 4 characters; pad with .
Input to decode not an even multiple of 4 characters; pad with .



作者: xcl3721    时间: 2014-04-23 16:23
补充,只要是更新的是中文,并且长度超过原先内容,就容易出现这个bug
求修复
作者: xcl3721    时间: 2014-04-23 16:31
目前我每次更新都是用truncate函数清空才可以正常工作
作者: happy_fish100    时间: 2014-05-06 10:42
做modify时,如果内容变短了,正确的做法就是要先要truncate啊
作者: happy_fish100    时间: 2014-05-06 10:43
另外,你用的FDFS版本是多少?
如果过低,modify操作不保证可以正常work!
作者: xcl3721    时间: 2014-05-21 13:45
收到谢群主,我改成每次自动truncate了~目前是5.0.1




欢迎光临 Chinaunix (http://bbs.chinaunix.net/) Powered by Discuz! X3.2