浏览代码

HPCC-15322 Allow Dali backup queue limits to be configured

Signed-off-by: Jake Smith <jake.smith@lexisnexis.com>
Jake Smith 9 年之前
父节点
当前提交
c71a976710
共有 3 个文件被更改,包括 34 次插入7 次删除
  1. 12 6
      dali/base/dasds.cpp
  2. 21 0
      initfiles/componentfiles/configxml/dali.xsd
  3. 1 1
      initfiles/componentfiles/configxml/dali.xsl

+ 12 - 6
dali/base/dasds.cpp

@@ -1040,6 +1040,12 @@ class CBackupHandler : public CInterface, implements IThreaded
     CTimeMon warningTime;
     unsigned recentTimeThrottled;
     unsigned lastNumWarnItems;
+    IPropertyTree &config;
+
+    const unsigned defaultFreeQueueLimit = 50;
+    const unsigned defaultLargeWarningThreshold = 50;
+    const unsigned defaultSoftQueueLimit = 200;
+    const unsigned defaultSoftQueueLimitDelay = 200;
 
     BackupQueueItem *getFreeItem()
     {
@@ -1159,18 +1165,18 @@ class CBackupHandler : public CInterface, implements IThreaded
     }
 
 public:
-    CBackupHandler() : threaded("CBackupHandler")
+    CBackupHandler(IPropertyTree &_config) : config(_config), threaded("CBackupHandler")
     {
         currentEdition = (unsigned)-1;
         addWaiting = waiting = async = false;
         aborted = true;
         throttleCounter = 0;
-        freeQueueLimit = 10;
-        largeWarningThreshold = 50;
-        softQueueLimit = 200;
-        softQueueLimitDelay = 200;
         recentTimeThrottled = 0;
         lastNumWarnItems = 0;
+        freeQueueLimit = config.getPropInt("@backupFreeQueueLimit", defaultFreeQueueLimit);
+        largeWarningThreshold = config.getPropInt("@backupLargeWarningThreshold", defaultLargeWarningThreshold);
+        softQueueLimit = config.getPropInt("@backupSoftQueueLimit", defaultSoftQueueLimit);
+        softQueueLimitDelay = config.getPropInt("@backupSoftQueueLimitDelay", defaultSoftQueueLimitDelay);
     }
     ~CBackupHandler()
     {
@@ -5720,7 +5726,7 @@ IStoreHelper *createStoreHelper(const char *storeName, const char *location, con
 #endif
 
 CCovenSDSManager::CCovenSDSManager(ICoven &_coven, IPropertyTree &_config, const char *_dataPath) 
-    : coven(_coven), config(_config), server(*this), dataPath(_dataPath)
+    : coven(_coven), config(_config), server(*this), dataPath(_dataPath), backupHandler(_config)
 {
     config.Link();
     restartOnError = config.getPropBool("@restartOnUnhandled");

+ 21 - 0
initfiles/componentfiles/configxml/dali.xsd

@@ -303,6 +303,27 @@
         </xs:appinfo>
       </xs:annotation>
     </xs:attribute>
+    <xs:attribute name="backupLargeWarningThreshold" type="xs:nonNegativeInteger" use="optional" default="50">
+      <xs:annotation>
+        <xs:appinfo>
+          <tooltip>Granularity of pending backups to begin issue warnings about backlog</tooltip>
+        </xs:appinfo>
+      </xs:annotation>
+    </xs:attribute>
+    <xs:attribute name="backupSoftQueueLimit" type="xs:nonNegativeInteger" use="optional" default="200">
+      <xs:annotation>
+        <xs:appinfo>
+          <tooltip>Limit above which the backup queue will start introducing delays until the backup queue decreases below this limit</tooltip>
+        </xs:appinfo>
+      </xs:annotation>
+    </xs:attribute>
+    <xs:attribute name="backupSoftQueueLimitDelay" type="xs:nonNegativeInteger" use="optional" default="200">
+      <xs:annotation>
+        <xs:appinfo>
+          <tooltip>The maximum delay to introduce when the backupSoftQueueLimit has been introduced</tooltip>
+        </xs:appinfo>
+      </xs:annotation>
+    </xs:attribute>
   </xs:attributeGroup>
    <xs:attributeGroup name="DFS">
     <!--DOC-Autobuild-code-->

+ 1 - 1
initfiles/componentfiles/configxml/dali.xsl

@@ -123,7 +123,7 @@
             <xsl:with-param name="val" select="@recoverFromIncErrors"/>
           </xsl:call-template>
         </xsl:attribute>
-        <xsl:copy-of select="@snmpErrorMsgLevel | @msgLevel | @lightweightCoalesce | @keepStores"/>
+        <xsl:copy-of select="@snmpErrorMsgLevel | @msgLevel | @lightweightCoalesce | @keepStores | @backupLargeWarningThreshold | @backupSoftQueueLimit | @backupSoftQueueLimitDelay"/>
         <xsl:attribute name="lCIdlePeriod">
           <xsl:value-of select="@IdlePeriod"/>
         </xsl:attribute>