From 816662b8418538b7cccefb1fe2d7aff77f66be69 Mon Sep 17 00:00:00 2001
From: Matthew Swift <matthew.swift@forgerock.com>
Date: Fri, 12 Jun 2015 20:48:00 +0000
Subject: [PATCH] Additional fix for OPENDJ-2136: Add a configuration option for checkpoint interval in PDB

---
 opendj-maven-plugin/src/main/resources/config/xml/org/forgerock/opendj/server/config/PDBBackendConfiguration.xml |   38 +++++++++++++++++++-------------------
 opendj-server-legacy/src/main/java/org/opends/server/backends/pdb/PDBStorage.java                                |    2 +-
 opendj-server-legacy/resource/schema/02-config.ldif                                                              |    3 ++-
 3 files changed, 22 insertions(+), 21 deletions(-)

diff --git a/opendj-maven-plugin/src/main/resources/config/xml/org/forgerock/opendj/server/config/PDBBackendConfiguration.xml b/opendj-maven-plugin/src/main/resources/config/xml/org/forgerock/opendj/server/config/PDBBackendConfiguration.xml
index b032638..f08f97f 100644
--- a/opendj-maven-plugin/src/main/resources/config/xml/org/forgerock/opendj/server/config/PDBBackendConfiguration.xml
+++ b/opendj-maven-plugin/src/main/resources/config/xml/org/forgerock/opendj/server/config/PDBBackendConfiguration.xml
@@ -246,29 +246,29 @@
           </ldap:attribute>
       </adm:profile>
   </adm:property>
-  <adm:property name="db-checkpoint-interval" advanced="true">
-  	  <adm:synopsis>
-        Checkpoint interval in seconds
-      </adm:synopsis>
-      <adm:description>
+  <adm:property name="db-checkpointer-wakeup-interval" advanced="true">
+    <adm:synopsis>
+      Specifies the maximum length of time that may pass between checkpoints.
+    </adm:synopsis>
+    <adm:description>
         This setting controls the elapsed time between attempts to write 
         a checkpoint to the journal. A longer interval allows more updates
         to accumulate in buffers before they are required to be written to
         disk, but also potentially causes recovery from an abrupt termination
         (crash) to take more time.
-      </adm:description>
-      <adm:default-behavior>
-          <adm:defined>
-              <adm:value>15</adm:value>
-          </adm:defined>
-      </adm:default-behavior>
-      <adm:syntax>
-          <adm:size lower-limit="0" />
-      </adm:syntax>
-      <adm:profile name="ldap">
-          <ldap:attribute>
-              <ldap:name>ds-cfg-db-checkpoint-interval</ldap:name>
-          </ldap:attribute>
-      </adm:profile>
+    </adm:description>
+    <adm:default-behavior>
+      <adm:defined>
+        <adm:value>15s</adm:value>
+      </adm:defined>
+    </adm:default-behavior>
+    <adm:syntax>
+      <adm:duration base-unit="s" lower-limit="10" upper-limit="3600" />
+    </adm:syntax>
+    <adm:profile name="ldap">
+      <ldap:attribute>
+        <ldap:name>ds-cfg-db-checkpointer-wakeup-interval</ldap:name>
+      </ldap:attribute>
+    </adm:profile>
   </adm:property>
 </adm:managed-object>
diff --git a/opendj-server-legacy/resource/schema/02-config.ldif b/opendj-server-legacy/resource/schema/02-config.ldif
index ace6692..06f22b2 100644
--- a/opendj-server-legacy/resource/schema/02-config.ldif
+++ b/opendj-server-legacy/resource/schema/02-config.ldif
@@ -5764,7 +5764,8 @@
         ds-cfg-db-cache-size $
         ds-cfg-db-txn-no-sync $
         ds-cfg-disk-full-threshold $
-        ds-cfg-disk-low-threshold )
+        ds-cfg-disk-low-threshold $
+        ds-cfg-db-checkpointer-wakeup-interval )
   X-ORIGIN 'OpenDJ Directory Server' )
 objectClasses: ( 1.3.6.1.4.1.36733.2.1.2.24
   NAME 'ds-cfg-backend-index'
diff --git a/opendj-server-legacy/src/main/java/org/opends/server/backends/pdb/PDBStorage.java b/opendj-server-legacy/src/main/java/org/opends/server/backends/pdb/PDBStorage.java
index 0fc0fa9..8df442f 100644
--- a/opendj-server-legacy/src/main/java/org/opends/server/backends/pdb/PDBStorage.java
+++ b/opendj-server-legacy/src/main/java/org/opends/server/backends/pdb/PDBStorage.java
@@ -693,7 +693,7 @@
     final Configuration dbCfg = new Configuration();
     dbCfg.setLogFile(new File(backendDirectory, VOLUME_NAME + ".log").getPath());
     dbCfg.setJournalPath(new File(backendDirectory, JOURNAL_NAME).getPath());
-    dbCfg.setCheckpointInterval(config.getDBCheckpointInterval());
+    dbCfg.setCheckpointInterval(config.getDBCheckpointerWakeupInterval());
     dbCfg.setVolumeList(asList(new VolumeSpecification(new File(backendDirectory, VOLUME_NAME).getPath(), null,
         BUFFER_SIZE, 4096, Long.MAX_VALUE / BUFFER_SIZE, 2048, true, false, false)));
     final BufferPoolConfiguration bufferPoolCfg = getBufferPoolCfg(dbCfg);

--
Gitblit v1.10.0