bug 7055: reschedule all policies after management server restart

test:
1. create policies for serveral volume.
2. stop management server
3. detele serveral rows in snapshot_schedule
4. start management server
5. check if the deleted row come back

status 7055: resolved fixed
This commit is contained in:
anthony 2010-11-08 18:22:44 -08:00
parent 964e013dc8
commit d695e0f5ba
1 changed files with 8 additions and 0 deletions

View File

@ -385,6 +385,14 @@ public class SnapshotSchedulerImpl implements SnapshotScheduler {
@Override @DB
public boolean start() {
//reschedule all policies after management restart
List<SnapshotPolicyVO> policyInstances = _snapshotPolicyDao.listAll();
for( SnapshotPolicyVO policyInstance : policyInstances) {
if( policyInstance.getId() != Snapshot.MANUAL_POLICY_ID ) {
scheduleNextSnapshotJob(policyInstance);
}
}
if (_testTimerTask != null) {
_testClockTimer = new Timer("TestClock");
// Run the test clock every 60s. Because every tick is counted as 1 minute.