The AlternatingFlushSchedulerV1 is an alternating driver, which essentially means that it either allows data to flow into a pool, or data going from a pool onto an HSM system but never both at the same time. Data transfers from pools to other pools or from pools to clients are not controlled by this driver. In order to minimize the latter one should configure HSM write pools to not allow transfers to clients but doing pool to pool transfers first.
# create diskCacheV111.hsmControl.flush.HsmFlushControlManager <FlushManagerName> \ "<flushPoolGroup> \ -export -replyObject \ -scheduler=diskCacheV111.hsmControl.flush.driver.AlternatingFlushSchedulerV1 \ -driver-config-file=${config}/<flushDriverConfigFile> \ " #
Where <flushPoolGroup> is a PoolGroup
defined in the PoolManager.conf
file,
containing all pools which are intended to be managed by this
FlushManager. <flushDriverConfigFile>
is a file within the dCache config
directory holding property
values for this driver. The driver reloads the file whenever
it changes its modification time. One should allow for a
minute of two before new setting are getting activated. The
configuration file has to contain key value pairs, separated
by the = sign. Keys, not corresponding to a driver property
are silently ignored. Properties, not set in the
configuration file, are set to some reasonable default value.
Driver properties may be specified by a configuration file as described above or by talking to the driver directly using the command line interface. Driver property commands look like :
driver properties -<PropertyName>=<value>
Because the communication with the driver is asynchronous, this command will never return an error. To check if the new property value has been accepted by the driver, run the sequence
driver properties info
It will list all available properties together with the currently active values.
Table 11.1. Driver Properties
Property Name | Default Value | Meaning |
---|---|---|
max.files | 500 | Collect this number of files per pool, before flushing |
max.minutes | 120 | Collect data for this amount of minutes before flushing |
max.megabytes | 500 * 1024 | Collecto this number of megabytes per pool before flushing |
max.rdonly.fraction | 0.5 | Do not allow more than this percentage of pools to be set read only |
flush.atonce | 0 | Never flush more than that in one junk |
timer | 60 | Interval timer (minimum resolution) |
print.events | false | Print events delivered by the FlushManager |
print.rules | false | Print remarks from the rule engine |
print.poolset.progress | false | Print progress messages |
Finding all flush candidates
A pool is becoming a flush candidate if either the number of files collected exceeds
max.files
or the number of megabytes collected exceedsmax.megabytes
or the oldest file, not flushed yet, is becoming older thanmax.minutes
.
Selecting the best candidate
Pool Candidates are sorted according to a metric, which is essentially the sum of three items. The number of files devided by
max.files
, the number of megabytes devided bymax.megabytes
and the age of the oldest file devided bymax.minutes
.The pool with the highest metric is chosen first. The driver determines the hardware unit, this pools resides on. The intention is to flush all pools of this unit simultanionsly. Depending on the configuration, the unit can be either a disk partition or a host. After the hardware unit is determined, the driver adds the number of pools on that unit to the number of pools already in ’read only’ mode. If this sum exceeds the total number of pools in the flush pool group, multiplied by the
max.rdonly.fraction
property, the pool is NOT selected. The process proceeds until a pool, resp. a hardware unit complies with these contrains.The hardware unit, a pool belongs to, is set by the ’tag.hostname’ field in the
config/<hostname>
file.
The actual flush process
If a pool is flushed, all storage groups of that pool are flushed, and within each storage group all precious files are flushed simultaniously. Setting the property
flush.atonce
to some positive nonzero number will advise each storage group not to flush more than this number of files per flush operation. There is no way to stop a flush operation which has been triggered by the FlushManager. The pool will proceed until all files, belonging to this flush operation, have been successfully flushed or failed to flush. Though, the next section describes how to suspend the flush pool selection mechanism.
The driver can be advised to suspend all new flush operations and switch to halt mode.
driver command suspend
To resume flushing :
driver command resume
In suspend mode, all flushing is halted which sooner or later results in overflowing write pools.
Flush Manager operations can be visualized by configuring the flush web pages, described in one of the subsequent sections or by using the flush module of the ’org.pcells’ GUI. In addition to monitoring, both mechanisms allow to set the pool I/O mode (rdOnly, readWrite) and to flush individual storage groups or pools. The problem may be that those manual interactions interfere with driver operations. The AlternatingFlushSchedulerV1 tries to cope with manual interactions as follows :
The pool I/O mode may be manually set to
read only
while the pool is not flushing data and therefor naturally would be in read write mode. If this pool is then subsequently chosen for flushing, and the flushing process has finished, the pool is NOT set back to readWrite mode, as it usually would be, but it stays in readOnly mode, because the driver found this mode when starting the flush process and assumes that it had been in that mode for good reason. So, setting the pool I/O mode to readOnly while the pool is not flushing freezes this mode until manually changed again. Setting the I/O mode to readOnly while the pool is flushing, has no effect.If a pool is in readOnly mode because the driver has been initiating a flush process, and the pool is manually set back to readWrite mode, is stays in readWrite mode during this flush process. After the flush sequence has finished, the pool is set back to normal as if no manual intervention had taken place. It does not stay with readWrite mode forever as it stays in readOnly mode forever in the example above.
When using the web interface or the GUI for flushing pools or individual storage groups, one is responsible for setting the pool I/O mode oneself.