Skip to content
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

KeyValueStore: move buffers from strip_header to BufferTransaction #2889

Merged
merged 1 commit into from
Nov 11, 2014

Conversation

xuechendi
Copy link
Contributor

This patch is related to the patch #2875
This patch is another way to get rid of the 'osd crash' problem during KeyValueStore test

'strip_header' in KeyValueStore is used to cache all updated headers, 'buffers' is used to ensure all io in one transaction use buffers to access the lastest update.
Move buffers from strip_header to BufferTransaction can ensure 'buffers' being destructed after the transaction being submitted, which prevent growing 'strip_header->buffers' causing OOM problem.
Also, for all 'meta collection' will be cached in strip_header, and there lacks of lock of parallel io accessing meta collection, multi-thread accesing the 'meta collection' strip_header->buffers causes segmentation fault, when moving 'buffers' from strip_header to BufferTransaction can prevent such scenario.

Signed-off-by: Chendi.Xue chendi.xue@intel.com

@@ -249,6 +249,8 @@ class KeyValueStore : public ObjectStore,

//Dirty records
StripHeaderMap strip_headers;
map<pair<string, string>, bufferlist> buffers; // pair(prefix, key),to buffer updated data in one transaction
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

map<pair<string, string> bufferlist> isn't enough to locate the unique bufferlist. Multi object may exists in the same BufferTransaction, so we need ghobject_t key to unique it

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

The codes is under a seq write 64k test to write 200GB data from rbd volume, and a rand write 4k test for 700secs without any osd crash
Please help to review, thx

Signed-off-by: Chendi.Xue <chendi.xue@intel.com>
@xuechendi xuechendi force-pushed the move_buffers_to_BufferTransaction branch from 341eb47 to 54ee8ee Compare November 10, 2014 12:17
@yuyuyu101
Copy link
Member

It seemed good to me!

liewegas added a commit that referenced this pull request Nov 11, 2014
…tion

KeyValueStore: move buffers from strip_header to BufferTransaction

Reviewed-by: Haomai Wang <haomaiwang@gmail.com>
@liewegas liewegas merged commit 21bb2b0 into ceph:master Nov 11, 2014
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
3 participants