New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
kv: In memory keyvalue db implementation #9933
Conversation
@liewegas please review and merge. |
sweeeeet! Thanks Ramesh! Very excited to play with this. |
@markhpc you are welcome. But this is just start, might have to tune it for concurrency. |
2b125a9
to
23c870c
Compare
@liewegas All tests in ceph_test_objectstore and ceph_test_keyvaluedb passes now. Only problem was the libsnappy issue. |
@chhabaramesh got a chance to test this today. A couple of observations:
|
@markhpc , Thanks, will look in to it today. |
@markhpc , I fixed the make file issue as suggested. When do you hit segfault? Can you please tell exact test you are doing? |
@chhabaramesh segfault happened about 0.3s after OSD initialization, but may only be on the first couple of OSDs (at least it is in this test). Looks like the segfaults probably happened during initial default pool creation. |
A good test BTW would be to set the mon_keyvaluedb and
filestore_omap_backend to memdb and see if vstart works as expected.
|
Did a quick test with mon_keyvaluedb set to memdb which results in: 2016-06-29 11:42:38.494078 7f172b662500 -1 unable to read magic from mon data No segfaults, mon just doesn't appear to like it. Even with debug 20 there's not much in the mon log to look at. |
094a7dd
to
9ec68bb
Compare
|
||
#define CEPH_MS_CONTAINER_NAME "ceph_kv_store" | ||
|
||
class MSStore : public KeyValueDB |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Can we call it MemDB{.h,.cc}?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Sure, will change it.
|
||
std::string MSStore::_get_data_fn() | ||
{ | ||
string fn = m_db_path+"//"+"MemDB.db"; |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
single /, spaces between operators and operands
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
will do that.
I pushed several patches to https://github.com/liewegas/ceph/commits/wip-mondb.. enough to get the monitor to get most of the way into its startup sequence with 'mon keyvaluedb = memdb'. But it quickly crashes in the iterator code. |
Ah, I disabled the snapshot iterator usage in mon and now it works! |
|
||
int MSStore::_rmkey(ms_op_t &op) | ||
{ | ||
std::lock_guard<std::mutex> l(m_lock); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
could shrink critical section (and elsewhere)?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Yes, I will take utility code out of lock and break code wherever possible. Also, I have in mind overall concurrency improvement for this code using multiple btrees.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Only thing I can take out of lock is combine strings. Rest needs to be under the lock. For example getting old value and then erasing it needs to be atomic, otherwise erase might fault.
aa58360
to
a0e41b4
Compare
We need to test and merge #10102 first, then rebase this on top. |
Otherwise this looks good to me! |
#10102 is merged. |
598fe9f
to
0eac96b
Compare
Signed-off-by: Ramesh Chander <Ramesh.Chander@sandisk.com>
Sounds to me like we should merge it! |
The TreeX class in cohort_lru.h does something along those lines, but is based on the boost::intrusve tree interface. |
In memory key value db implementation with google btree map.
First version with minimal functional implementation.
Signed-off-by: Ramesh Chander Ramesh.Chander@sandisk.com