Hi,

I am using jackrabbit version 2.4.3 with versioning.
Please find attached my repository.xml.
I am using MySqlPersistenceManager.
I have 2 hosts ( each with its own clusterId) sharing the same workspace in the 
repository.

When we enabled versioning, our consistency check on startup increased to 
nearly an hour and half , sometimes more.
Also, within 3 days, our hosts were recording lots of errors on itemSave and 
invalidItemState exceptions. Eventually our machine became  un-responsive so we 
had to disable versioning.

While debugging the root cause, I found the following:


the V_ are the versioning related tables
I was hoping that rowcount(R_V_PM_BUNDLE ) <= row count(  R_PM_DEFAULT_BUNDLE) 
since they both contain NODE_ID as foreign key.
The nodeIds seem to be in some encoded / compressed format so I couldn't 
compare the columns directly.
But my understanding from the  JSR spec is that there should be 1-1 
correspondence between the actual nodes and their versioned storage.

1. Can the number of nodes in version bundle be greater than that in the 
workspace bundle table?
2. Is there some cleanup functionality for versioning, if so, how can I 
configure it?
3. Is there any way to fasten the consistency check?
4. Are these any limitations/recommendations related to the number of nodes as 
far as versioning goes?



select table_schema, table_type, table_name, table_rows from 
INFORMATION_SCHEMA.TABLES  where table_rows>=1;
+---------------+------------+---------------------------------------------------+------------+
| table_schema  | table_type | table_name                                       
 | table_rows |
+---------------+------------+---------------------------------------------------+------------+

correctzestdb | BASE TABLE | J_GLOBAL_REVISION                                 
|          1 |
| correctzestdb | BASE TABLE | J_JOURNAL                                        
 |      31824 |
| correctzestdb | BASE TABLE | J_LOCAL_REVISIONS                                
 |          2 |
| correctzestdb | BASE TABLE | QRTZ_CRON_TRIGGERS                               
 |          3 |
| correctzestdb | BASE TABLE | QRTZ_JOB_DETAILS                                 
 |          3 |
| correctzestdb | BASE TABLE | QRTZ_LOCKS                                       
 |          5 |
| correctzestdb | BASE TABLE | QRTZ_SCHEDULER_STATE                             
 |          2 |
| correctzestdb | BASE TABLE | QRTZ_TRIGGERS                                    
 |          3 |
| correctzestdb | BASE TABLE | R_FS_DEFAULT_FSENTRY                             
 |          1 |
| correctzestdb | BASE TABLE | R_FS_FSENTRY                                     
 |          8 |
| correctzestdb | BASE TABLE | R_FS_SECURITY_FSENTRY                            
 |          1 |
| correctzestdb | BASE TABLE | R_PM_DEFAULT_BUNDLE                              
 |     142970 |
| correctzestdb | BASE TABLE | R_PM_SECURITY_BUNDLE                             
 |         10 |
| correctzestdb | BASE TABLE | R_V_FS_FSENTRY                                   
 |          1 |
| correctzestdb | BASE TABLE | R_V_PM_BUNDLE                                    
 |     450445 |
| correctzestdb | BASE TABLE | R_V_PM_REFS                                      
 |        600 |
| correctzestdb | BASE TABLE | accounts                                         
 |         64 |

mysql> desc correctzestdb.R_PM_DEFAULT_BUNDLE   ;
+-------------+---------------+------+-----+---------+-------+
| Field       | Type          | Null | Key | Default | Extra |
+-------------+---------------+------+-----+---------+-------+
| NODE_ID     | varbinary(16) | NO   | PRI | NULL    |       |
| BUNDLE_DATA | longblob      | NO   |     | NULL    |       |
+-------------+---------------+------+-----+---------+-------+
2 rows in set (0.00 sec)

mysql> desc correctzestdb. R_V_PM_BUNDLE;
+-------------+---------------+------+-----+---------+-------+
| Field       | Type          | Null | Key | Default | Extra |
+-------------+---------------+------+-----+---------+-------+
| NODE_ID     | varbinary(16) | NO   | PRI | NULL    |       |
| BUNDLE_DATA | longblob      | NO   |     | NULL    |       |
+-------------+---------------+------+-----+---------+-------+
2 rows in set (0.00 sec)
<?xml version="1.0"?>
<!-- This configuration to be used if the repository to be
     setup in MySQL database
-->
<!DOCTYPE Repository
          PUBLIC "-//The Apache Software Foundation//DTD Jackrabbit 2.0//EN"
          "http://jackrabbit.apache.org/dtd/repository-2.0.dtd";>

<Repository>
  <FileSystem class="org.apache.jackrabbit.core.fs.db.DbFileSystem">
    <param name="driver" value="com.mysql.jdbc.Driver"/>
    <param name="url" value="jdbc:mysql://${ycpDBHostName}:${ycpDBPortNum}/${ycpDBName}?${ycpDBSSL}"/>
    <param name="user" value="${ycpDBUserName}"/>
    <param name="password" value="${ycpDBPassword}"/>
    <param name="schema" value="mysql"/>
    <param name="schemaObjectPrefix" value="r_fs_"/>
  </FileSystem>
  
  <Security appName="Jackrabbit">    
    <SecurityManager class="org.apache.jackrabbit.core.DefaultSecurityManager" workspaceName="security">
      <UserIdClass class="com.yahoo.ycp.security.YcpPrincipal"/>
    </SecurityManager>
    <AccessManager class="com.yahoo.ycp.security.YcpAccessManager"></AccessManager>
    <LoginModule class="com.yahoo.ycp.security.YcpLogin"></LoginModule>
  </Security>

  <DataStore class="org.apache.jackrabbit.core.data.db.DbDataStore">
    <param name="driver" value="com.mysql.jdbc.Driver"/>
    <param name="url" value="jdbc:mysql://${ycpDBHostName}:${ycpDBPortNum}/${ycpDBName}?${ycpDBSSL}"/>
    <param name="user" value="${ycpDBUserName}"/>
    <param name="password" value="${ycpDBPassword}"/>
    <param name="databaseType" value="mysql"/>
    <param name="schemaObjectPrefix" value="r_ds_"/>
  </DataStore>

  <Workspaces rootPath="${rep.home}/workspaces" defaultWorkspace="default"/>
  <Workspace name="${wsp.name}">
    <FileSystem class="org.apache.jackrabbit.core.fs.db.DbFileSystem">
      <param name="driver" value="com.mysql.jdbc.Driver"/>
      <param name="url" value="jdbc:mysql://${ycpDBHostName}:${ycpDBPortNum}/${ycpDBName}?${ycpDBSSL}"/>
      <param name="user" value="${ycpDBUserName}"/>
      <param name="password" value="${ycpDBPassword}"/>
      <param name="schema" value="mysql"/>
      <param name="schemaObjectPrefix" value="r_fs_${wsp.name}_"/>
    </FileSystem>

    <PersistenceManager class="org.apache.jackrabbit.core.persistence.pool.MySqlPersistenceManager">
      <param name="url" value="jdbc:mysql://${ycpDBHostName}:${ycpDBPortNum}/${ycpDBName}?${ycpDBSSL}"/>
      <param name="user" value="${ycpDBUserName}" />
      <param name="password" value="${ycpDBPassword}" />
      <param name="schema" value="mysql"/>
      <param name="schemaObjectPrefix" value="r_pm_${wsp.name}_"/>
      <param name="externalBLOBs" value="false" />
      <!-- Enable consistency check on start -->
      <param name="consistencyCheck" value="true"/>
      <param name="consistencyFix" value="true"/>
    </PersistenceManager>

    <SearchIndex class="org.apache.jackrabbit.core.query.lucene.SearchIndex">
      <param name="path" value="${wsp.home}/index"/>
      <param name="analyzer"  value="org.apache.lucene.analysis.standard.StandardAnalyzer" />
      <param name="queryClass" value="org.apache.jackrabbit.core.query.QueryImpl" />
      <param name="respectDocumentOrder" value="true" />
      <param name="resultFetchSize" value="102" />
      <!-- Enable consistency check on startup -->
      <param name="autoRepair" value="true" />
      <param name="enableConsistencyCheck" value="true"/>
      <param name="forceConsistencyCheck" value="true"/>
    </SearchIndex>


  </Workspace>

  <Versioning rootPath="${rep.home}/version">
    <FileSystem class="org.apache.jackrabbit.core.fs.db.DbFileSystem">
      <param name="driver" value="com.mysql.jdbc.Driver"/>
      <param name="url" value="jdbc:mysql://${ycpDBHostName}:${ycpDBPortNum}/${ycpDBName}?${ycpDBSSL}"/>
      <param name="user" value="${ycpDBUserName}"/>
      <param name="password" value="${ycpDBPassword}"/>
      <param name="schema" value="mysql"/>
      <param name="schemaObjectPrefix" value="r_v_fs_"/>
    </FileSystem>
    <PersistenceManager class="org.apache.jackrabbit.core.persistence.pool.MySqlPersistenceManager">
      <param name="url" value="jdbc:mysql://${ycpDBHostName}:${ycpDBPortNum}/${ycpDBName}?${ycpDBSSL}"/>
      <param name="user" value="${ycpDBUserName}" />
      <param name="password" value="${ycpDBPassword}" />
      <param name="schema" value="mysql"/>
      <param name="schemaObjectPrefix" value="r_v_pm_"/>
      <param name="externalBLOBs" value="false" />
      <!-- Enable consistency check on start -->
      <param name="consistencyCheck" value="true"/>
      <param name="consistencyFix" value="true"/>
    </PersistenceManager>
  </Versioning>

  <Cluster id="${ycpClusterId}" syncDelay="1000">
    <Journal class="org.apache.jackrabbit.core.journal.DatabaseJournal">
      <param name="driver" value="com.mysql.jdbc.Driver"/>
      <param name="url" value="jdbc:mysql://${ycpDBHostName}:${ycpDBPortNum}/${ycpDBName}?${ycpDBSSL}"/>
      <param name="user" value="${ycpDBUserName}" />
      <param name="password" value="${ycpDBPassword}" />
      <param name="schema" value="mysql"/>
      <param name="schemaObjectPrefix" value="j_"/>
      <!-- following variables to control the janitor invokation 
      <param name="janitorEnabled" value="true" />
      <param name="janitorSleep" value="60" />
      <param name="janitorFirstRunHourOfDay" value="17" />
      -->
    </Journal>
  </Cluster>

</Repository>

Reply via email to