免费注册 查看新帖 |

Chinaunix

  平台 论坛 博客 文库
最近访问板块 发新帖
查看: 5233 | 回复: 5
打印 上一主题 下一主题

[FastDFS] fastdfs 5.01 bug 中文更新问题 [复制链接]

论坛徽章:
0
跳转到指定楼层
1 [收藏(0)] [报告]
发表于 2014-04-23 16:17 |只看该作者 |倒序浏览
本帖最后由 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 .


论坛徽章:
0
2 [报告]
发表于 2014-04-23 16:23 |只看该作者
补充,只要是更新的是中文,并且长度超过原先内容,就容易出现这个bug
求修复

论坛徽章:
0
3 [报告]
发表于 2014-04-23 16:31 |只看该作者
目前我每次更新都是用truncate函数清空才可以正常工作

论坛徽章:
4
2015年辞旧岁徽章
日期:2015-03-03 16:54:152015年迎新春徽章
日期:2015-03-04 09:56:11IT运维版块每日发帖之星
日期:2016-08-11 06:20:00IT运维版块每日发帖之星
日期:2016-08-15 06:20:00
4 [报告]
发表于 2014-05-06 10:42 |只看该作者
做modify时,如果内容变短了,正确的做法就是要先要truncate啊

论坛徽章:
4
2015年辞旧岁徽章
日期:2015-03-03 16:54:152015年迎新春徽章
日期:2015-03-04 09:56:11IT运维版块每日发帖之星
日期:2016-08-11 06:20:00IT运维版块每日发帖之星
日期:2016-08-15 06:20:00
5 [报告]
发表于 2014-05-06 10:43 |只看该作者
另外,你用的FDFS版本是多少?
如果过低,modify操作不保证可以正常work!

论坛徽章:
0
6 [报告]
发表于 2014-05-21 13:45 |只看该作者
收到谢群主,我改成每次自动truncate了~目前是5.0.1
您需要登录后才可以回帖 登录 | 注册

本版积分规则 发表回复

  

北京盛拓优讯信息技术有限公司. 版权所有 京ICP备16024965号-6 北京市公安局海淀分局网监中心备案编号:11010802020122 niuxiaotong@pcpop.com 17352615567
未成年举报专区
中国互联网协会会员  联系我们:huangweiwei@itpub.net
感谢所有关心和支持过ChinaUnix的朋友们 转载本站内容请注明原作者名及出处

清除 Cookies - ChinaUnix - Archiver - WAP - TOP