Bug 1028796

Summary: File System Based Cache Stores, should be change to SingleFileStore for 6.0.0 version of infinispan
Product: [JBoss] JBoss Data Grid 6 Reporter: Vitalii Chepeliuk <vchepeli>
Component: DocumentationAssignee: Misha H. Ali <mhusnain>
Status: CLOSED CURRENTRELEASE QA Contact:
Severity: unspecified Docs Contact:
Priority: unspecified    
Version: 6.2.0CC: jdg-bugs, ttarrant, vchepeli
Target Milestone: GA   
Target Release: 6.2.0   
Hardware: Unspecified   
OS: Unspecified   
Whiteboard:
Fixed In Version: Doc Type: Bug Fix
Doc Text:
Story Points: ---
Clone Of: Environment:
Build Name: 12532, Administration and Configuration Guide-6.2-Beta-3 Build Date: 06-11-2013 16:02:50 Topic ID: 5256-473380 [Latest]
Last Closed: 2014-01-16 00:03:27 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:

Description Vitalii Chepeliuk 2013-11-10 20:13:19 UTC
Title: File System Based Cache Stores

Describe the issue:
FileCacheStore is deprecated for infinispan 6.0.0 and SingleFileStore should be used
Suggestions for improvement:
FileCacheStore --> SingleFileStore

Additional information:
Not exactly sure, need to ask developers about that, because for version 5.3.0 it still remains and JDG server still has infinispan:server:core:5.3 in its configuration file

Comment 2 Tristan Tarrant 2013-11-13 08:23:08 UTC
While the new file-based cachestore is called SingleFileStore, it replaces the old FileCacheStore without any configuration changes. Also the SingleFileStore on startup will detect the files from the old FileCacheStore and transparently migrate the data to the new format.

Comment 3 Misha H. Ali 2013-11-14 05:25:23 UTC
Thanks, Tristan.

Changes:

1. straightforward search and replace FileCacheStore -> SingleFileStore in the following topics:

* 14.1. File System Based Cache Stores
* 14.1.1. Single File Store Configuration (Remote Client-Server Mode)
* 14.1.2. Single File Store Configuration (Library Mode)
* 17.2.2. Configure the Cache Loader using XML
* 17.2.3. Configure the Cache Loader Programmatically

Question:

* In another topic, we use the following in a programmatic config:

ConfigurationBuilder builder = new ConfigurationBuilder();
builder.loaders()
    .passivation(false)
    .shared(false)
    .preload(true)
    .addFileCacheStore() <<-- name change?

* In another instance, we have this as part of a config:

<loader class="org.infinispan.loaders.file.FileCacheStore" <-- any change?

Comment 4 Vitalii Chepeliuk 2013-11-14 12:08:48 UTC
(In reply to Misha H. Ali from comment #3)
> Thanks, Tristan.
> 
> Changes:
> 
> 1. straightforward search and replace FileCacheStore -> SingleFileStore in
> the following topics:
> 
> * 14.1. File System Based Cache Stores
> * 14.1.1. Single File Store Configuration (Remote Client-Server Mode)
> * 14.1.2. Single File Store Configuration (Library Mode)
> * 17.2.2. Configure the Cache Loader using XML
> * 17.2.3. Configure the Cache Loader Programmatically
> 
> Question:
> 
> * In another topic, we use the following in a programmatic config:
> 
> ConfigurationBuilder builder = new ConfigurationBuilder();
> builder.loaders()
>     .passivation(false)
>     .shared(false)
>     .preload(true)
>     .addFileCacheStore() <<-- name change?
> 
> * In another instance, we have this as part of a config:
> 
> <loader class="org.infinispan.loaders.file.FileCacheStore" <-- any change?

Not onle name Misha
ConfigurationBuilder builder = new ConfigurationBuilder();
builder.persistence().passivation(false).addSingleFileStore().location("/tmp/cache/").shared(false).preload(true);

Comment 7 Misha H. Ali 2013-11-18 11:19:27 UTC
For declarative (library mode) configs:

* Replaced <loader> with <store> here:

Admin Guide:
 -19.1.2. Write-Through Caching Configuration (Library Mode)

Developer Guide: 
- None found


* Replaced <loaders> with <persistence> here:

Admin Guide:
 - 14.5.4. Sample XML Configuration (this title will change)
 - 16.1.2. JdbcBinaryCacheStore Configuration (Library Mode)
 - 16.2.2. JdbcStringBasedCacheStore Configuration (Library Mode)
 - 16.3.2. JdbcMixedCacheStore Configuration (Library Mode)
 - 17.2.2. Configure the Cache Loader using XML
 - 18.2. Configure Passivation
 - 19.1.2. Write-Through Caching Configuration (Library Mode)
 - 19.2.3. Unscheduled Write-Behind Strategy Configuration (Library Mode)
 
Developer Guide:
 - None found

Phew, I think that should be all the instances. Can you have a look and verify they are now correct please, Vitalii.

Comment 8 Vitalii Chepeliuk 2013-11-25 14:59:06 UTC
I filed already bugs where I see some code snippet problems
And I think chapter 17 could be removed from admin guide because it's related to old version. But we should ask developers maybe they still use it somewhere

Comment 9 Misha H. Ali 2013-11-25 23:50:10 UTC
Thanks Vitalii. I'm flagging Tristan here to confirm whether we should exclude the Cache Loader config information. If we don't use these configs anymore, I can just add the "What is a cache loader" information to the cache store chaper.

Comment 10 Tristan Tarrant 2013-11-27 09:34:38 UTC
For the declarative configuration we should use the modern style. Instead of 

<persistence>
   <store class="org.infinispan.persistence.file.SingleFileStore">
     <properties>
       <property name="location" value="/tmp/Another-FileCacheStore-Location"/>
     </properties>
   </store>
</persistence>

we should be using:


<persistence>
   <singleFile location="/tmp/Another-FileCacheStore-Location"/>
</persistence>

Comment 11 Misha H. Ali 2013-11-27 10:36:52 UTC
Thanks, Tristan. Can I get you to confirm that the config should discard all the config elements and just be this config:

<persistence>
   <singleFile location="/tmp/Another-FileCacheStore-Location"/>
</persistence>

Or do we use this modern style and retain the other elements, for example:

<persistence passivation="false">
   <store class="org.infinispan.persistence.file.SingleFileStore"
           fetchPersistentState="false"
           ignoreModifications="false"
           purgeOnStartup="false">
      <properties>
         <singleFile location="/tmp/Another-FileCacheStore-Location"/>
      </properties>
   </store>
</persistence>

Comment 12 Tristan Tarrant 2013-11-27 10:52:59 UTC
You mixed everything up there :)

<persistence passivation="false">
  <singleFile fetchPersistentState="true" 
              ignoreModifications="false"
              purgeOnStartup="false" 
              shared="false"
              preload="false"
              location="/tmp/Another-FileCacheStore-Location">
    <async enabled="true" threadPoolSize="500" />
  </singleFile>
</persistence>

Comment 13 Misha H. Ali 2013-11-27 11:20:35 UTC
Thanks, Tristan.

This should be fixed now. Vitalii, could you QE this please:

http://docbuilder.usersys.redhat.com/12532/#Single_File_Store_Configuration_Library_Mode

Comment 14 Vitalii Chepeliuk 2013-11-27 11:36:26 UTC
Yes Tristan is right! And thanks Misha! Bug is verified

Comment 15 Misha H. Ali 2014-01-16 00:03:27 UTC
The fix for this bug is now generally released and available here:

https://access.redhat.com/site/documentation/en-US/Red_Hat_JBoss_Data_Grid/6.2/index.html