KeyValueStore: move buffers from strip_header to BufferTransaction #2889
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
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