Groups
Sign in
Groups
Shenzhen (深圳) Linux Unix User Group
Conversations
About
Send feedback
Help
有人用leveldb不?
112 views
Skip to first unread message
Liuheng
unread,
Mar 7, 2012, 1:29:40 AM
3/7/12
Reply to author
Sign in to reply to author
Forward
Sign in to forward
Delete
You do not have permission to delete messages in this group
Copy link
Report message
Sign in to report message
Show original message
Either email addresses are anonymous for this group or you need the view member email addresses permission to view the original message
to sz...@googlegroups.com
我在应用的一个模块里用leveldb存一些用户配置信息。
通信是用的zeroc-ice。 对leveldb的操作大概流程是这样:
在ice的一个接口函数里open->write->close.
另一个ice的接口函数里open->iterato->close.
也就是说, 有可能很频繁的并行的open/close leveldb。
现在leveldb打不开了, 我看了一下DB的目录里没有MANIFEST文件。
有人对这东西熟悉吗? 为什么会这样? 有办法恢复吗?
winter
unread,
Mar 7, 2012, 10:40:07 AM
3/7/12
Reply to author
Sign in to reply to author
Forward
Sign in to forward
Delete
You do not have permission to delete messages in this group
Copy link
Report message
Sign in to report message
Show original message
Either email addresses are anonymous for this group or you need the view member email addresses permission to view the original message
to sz...@googlegroups.com
只用过BerkeleyDB, 欢迎使用BerkeleyDB
Li Jie
unread,
Mar 8, 2012, 10:21:11 AM
3/8/12
Reply to author
Sign in to reply to author
Forward
Sign in to forward
Delete
You do not have permission to delete messages in this group
Copy link
Report message
Sign in to report message
Show original message
Either email addresses are anonymous for this group or you need the view member email addresses permission to view the original message
to sz...@googlegroups.com
2012/3/7 Liuheng <
liuheng...@gmail.com
>:
尝试用RepairDB()修复过吗?
--
Regards
Li Jie
jrckkyy
unread,
Mar 8, 2012, 9:52:39 PM
3/8/12
Reply to author
Sign in to reply to author
Forward
Sign in to forward
Delete
You do not have permission to delete messages in this group
Copy link
Report message
Sign in to report message
Show original message
Either email addresses are anonymous for this group or you need the view member email addresses permission to view the original message
to sz...@googlegroups.com
leveldb不支持并发读写
--
此致
敬礼!
Liuheng
unread,
Mar 8, 2012, 10:07:05 PM
3/8/12
Reply to author
Sign in to reply to author
Forward
Sign in to forward
Delete
You do not have permission to delete messages in this group
Copy link
Report message
Sign in to report message
Show original message
Either email addresses are anonymous for this group or you need the view member email addresses permission to view the original message
to sz...@googlegroups.com
这函数可以修复. 太谢谢你了!
http://code.google.com/p/leveldb/issues/detail?id=73
我提了一个UBG,希望用leveldb的人注意到这个问题。
文档里说的线程安全, 应该是指的多个线程里读写同一个DB对象是安全的。
像我那样用, DB是一定会坏的。
在 2012年3月8日 下午11:21,Li Jie
<
elts...@gmail.com
>
写道:
Liuheng
unread,
Mar 8, 2012, 10:09:16 PM
3/8/12
Reply to author
Sign in to reply to author
Forward
Sign in to forward
Delete
You do not have permission to delete messages in this group
Copy link
Report message
Sign in to report message
Show original message
Either email addresses are anonymous for this group or you need the view member email addresses permission to view the original message
to sz...@googlegroups.com
你是说怎么并发?
官方文档里说线程安全, 不能多进程操作。
Li Jie
unread,
Mar 8, 2012, 10:43:02 PM
3/8/12
Reply to author
Sign in to reply to author
Forward
Sign in to forward
Delete
You do not have permission to delete messages in this group
Copy link
Report message
Sign in to report message
Show original message
Either email addresses are anonymous for this group or you need the view member email addresses permission to view the original message
to sz...@googlegroups.com
2012/3/9 Liuheng <
liuheng...@gmail.com
>:
> 这函数可以修复. 太谢谢你了!
>
>
http://code.google.com/p/leveldb/issues/detail?id=73
> 我提了一个UBG,希望用leveldb的人注意到这个问题。
> 文档里说的线程安全, 应该是指的多个线程里读写同一个DB对象是安全的。
> 像我那样用, DB是一定会坏的。
我看到你是对一个DB存储Open了2个实例, 是一个写一个读吗?
--
Regards
Li Jie
Liuheng
unread,
Mar 8, 2012, 11:37:24 PM
3/8/12
Reply to author
Sign in to reply to author
Forward
Sign in to forward
Delete
You do not have permission to delete messages in this group
Copy link
Report message
Sign in to report message
Show original message
Either email addresses are anonymous for this group or you need the view member email addresses permission to view the original message
to sz...@googlegroups.com
是的。
关键的用意是在两个线程里对同一个DB各自open/close不同的指针。
按文档里的说法(我也浏览了一下原码), 这应该是互斥的。
但那测试程序每次运行都能让DB打开失败.
Reply all
Reply to author
Forward
0 new messages