Bug 1375231

Summary: Fix Caching Issues for MiqDiskCache Module
Product: Red Hat CloudForms Management Engine Reporter: John Prause <jprause>
Component: SmartState AnalysisAssignee: Jerry Keselman <jkeselma>
Status: CLOSED CURRENTRELEASE QA Contact: Jeff Teehan <jteehan>
Severity: unspecified Docs Contact:
Priority: unspecified    
Version: 5.6.0CC: jhardy, jprause, obarenbo, simaishi
Target Milestone: GAKeywords: TestOnly, ZStream
Target Release: 5.7.0   
Hardware: Unspecified   
OS: Unspecified   
Whiteboard:
Fixed In Version: 5.7.0.0 Doc Type: If docs needed, set a value
Doc Text:
Story Points: ---
Clone Of:
: 1376168 (view as bug list) Environment:
Last Closed: 2017-01-11 20:17:51 UTC Type: Bug
Regression: --- Mount Type: ---
Documentation: --- CRM:
Verified Versions: Category: ---
oVirt Team: --- RHEL 7.3 requirements from Atomic Host:
Cloudforms Team: CFME Core Target Upstream Version:
Bug Depends On:    
Bug Blocks: 1376168    

Description John Prause 2016-09-12 14:03:40 UTC
Several caching issues have been uncovered and will be addressed here.
Similar changes have been made in MiqHyperVDisk via separate PR.

1) Cache requests where the request overlapped an existing cache entry
both at the start and end resulted in new entry duplicating the existing
entry plus the data at start and end. This will instead be addressed by
creating new entries for the start and end and using the existing entry.
This is a performance issue.

2) Cache requests where the end of the request (but not the start) was present
in an existing cache entry used the incorrect offset into the entry for the data
returned. This is a data integrity issue.

3) The range of blocks cached for new entries was determined incorrectly.
Depending upon the request from the disk module less data might be cached than required.
This is a performance issue.

4) Concatenating cache entries with recursive calls to bread_cached used the "+"
operator exclusively. When possible this is changed to "<<" to eliminate some
temporary buffer allocation and speed things up a little.

5) Comments also added for clarity.

Comment 2 John Prause 2016-09-12 14:04:33 UTC
https://github.com/ManageIQ/manageiq/pull/10002

Comment 6 Jeff Teehan 2016-10-19 19:15:55 UTC
This change is working.  Checked SSA to verify all disk types are working.  Moving to verified.