Bug 1393566

Summary: LVM Cache: Be ready to consume cache metadata V2
Product: [Community] LVM and device-mapper Reporter: Jonathan Earl Brassow <jbrassow>
Component: lvm2Assignee: Zdenek Kabelac <zkabelac>
lvm2 sub component: Cache Logical Volumes QA Contact: cluster-qe <cluster-qe>
Status: CLOSED CURRENTRELEASE Docs Contact:
Severity: unspecified    
Priority: unspecified CC: agk, devurandom, heinzm, jbrassow, msnitzer, pasik, prajnoha, thornber, zkabelac
Version: unspecifiedFlags: agk: lvm-technical-solution+
rule-engine: lvm-test-coverage?
Target Milestone: ---   
Target Release: ---   
Hardware: Unspecified   
OS: Unspecified   
Whiteboard:
Fixed In Version: 2.02.169 Doc Type: If docs needed, set a value
Doc Text:
Story Points: ---
Clone Of:
: 1436748 (view as bug list) Environment:
Last Closed: 2019-08-21 18:28:35 UTC Type: Bug
Regression: --- Mount Type: ---
Documentation: --- CRM:
Verified Versions: Category: ---
oVirt Team: --- RHEL 7.3 requirements from Atomic Host:
Cloudforms Team: --- Target Upstream Version:
Bug Depends On:    
Bug Blocks: 1436748    

Description Jonathan Earl Brassow 2016-11-09 21:27:14 UTC
The on-disk metadata used by dm-cache is being updated to allow for performance enhancements.  LVM will need to pass down additional DM table arguments in order to activate these changes.  We need to have a solution ready that is forward/backwards compatible.

Comment 1 Zdenek Kabelac 2017-02-20 10:09:06 UTC
So lets list the options:

lvm2 new parameter:

1.) --cacheversion   1|2|auto

2.) --cache-metadata-version 2 ?

3.) --metadata-version 2  ?

4.) --cacheformat   1|2|auto    (or maybe this: v1|v2|auto ) ?


---

libdm API options:

1.) add new dm_tree_node_set_cache_version(....) 
2.) add new dm_tree_node_set_cache_format(....) 

3.) #define DM_CACHE_FEATURE_FORMAT_2 
4.) #define DM_CACHE_FEATURE_FORMAT_V2 
5.) #define DM_CACHE_FEATURE_VERSION_2 


---

ATM I'd prefer the format to be automatically recognized by the 'cache_check' tool - as adding some 'magical' args by lvm2 to the existing configurable set can be problematic for a user - it could be done - but lvm2 will be changing passed option set.

i.e. it's then unclear if we should use:

cache_check  --metadata-version 2

and also

cache_check  --metadata-version 1

or just use it with version 2 ?

---

Waiting for more judgment here.

Comment 2 Zdenek Kabelac 2017-03-28 18:01:27 UTC
So the upstream implementation uses:


lvcreate/lvconvert --cachemetadataformat auto|1|2  option to select format of cache metadata.

There is also support for metadata profile option:

allocation/cache_metadata_format   0|1|2    (0 == auto)

Expected usage is to pass this option while 'caching LV' - but it also work when you create cache-pool.

To see 'cachemetadataformat' in lvm2 metadata use: 'lvs -o+cachemetadataformat'
To see in-kernel format use: 'lvs -o+kernelmetadataformat' - but this is rather complementary function.

For cache-pool metadata format might be 'unselected'.
For actual cached LV it is always having value  1 or 2 (ATM).

For usage of metadata 2 format it's MANDATORY to have installed:
>= device-mapper-persistent-data-0.7.0-0.1.rc6