DFS Backup
(version 0.3)
Mission Statement
Due to serious deficiencies in the standard
DFS backup system, which makes is unsuitable for CERN requirements, new
backup system will be developed locally in CERN. The developed backup system
will be flexible, easily maintainable and will offer simple interface for
operator tasks and for end-user tasks. The procedures for dealing with
unexpected situations will be included. It will be possible to reuse the
package with different uderlaying backup mechanism in future.
The alpha version of the backup
system should be ready in September 97, followed by beta version in October
97. The full package should be in operation in till the end of 97.
Case Study
-
Normal Operation
-
Backup Initialisation: The Database is created, jobs are scheduled.
-
Backup Dump: The Database is dumped.
-
Backup: Backup runs unattended under normal circumstances. The only
required operator actions are visual labeling of new tapes and changing
tapes in certain times.
-
Recent Restore: Restore of entities backuped within current period
works without operator attendance. User will reclaim those entities via
standard interface.
-
Old Restore: For restore of entities from previous periods, operator
may be required to put certain tapes into drive. For user, this operation
looks the same as Recent Restore.
-
Problems
-
Backup Recovery: The corrupted Database is restored.
-
Filesystem Crash: Restore after aggregate or partition is lost
is just normal Restore.
-
Tape Unreadable: If any tape is unreadable, restore will be done
with most recent available backup and new backup (new phase) will be started
immediately to replace bad tape.
-
Server Crash: If server crashes, the full set of data will be restored
on another (new) server.
-
Database Lost: If the Database is lost, one of backup copies of
that database will be used. The database can be recreated from information
stored in tapes.
-
Backup Failure: If any backup phase fails, it will be restarted
immediately when possible. Next phase may be postponed till failed phase
is performed.
Requirements
Definitions
-
Period: The time when subsequent backups are placed in one set of
tapes.
-
Current Period: Period, with tapes still inside the drives.
-
Entity: Set of data, which is backuped or restored together (usually
fileset).
-
Schema: The prescription, how and when are certain Entities backuped.
-
Database: The system which keeps all information about Schemas and
performed backups.
Requirements
-
Functional Requirements
-
Standard Backup: Under normal circumstances backup should run without
operator intervention, except for periodic visual labeling and changing
tapes in the begining of period.
-
Restore of Recent Backup: Under normal circumstances restore of
entities backuped within current period should run without operator attendance.
-
Restore of Old Backup: Restore entity which is not present on current
period (either at all or the required version) should be possible. Operator
attendance may be required.
-
Entity Description: Each Entity should have unique description.
-
Database Lost: There should be at least two copies of the Database
on different mediae.
-
Database Structure: Database should be structured in human readable
format.
-
Schema Change: It should be possible to change Schema between two
Periods.
-
Backup Entities: These Entities should be available for Backup:
-
Fileset.
-
Restore Entities: These Entities should be available for Restore:
-
Single directory.
-
Fileset.
-
Period Duration: Period should last at least one week.
-
Period Periodicity: All periods should last the same time.
-
Period Content: Set of tapes for one Period should contain at least
one Full Backup of all backuped Entities.
-
Backup UI: User interface for Backup operation should exist.
-
Restore UI: User interface for Restore operation should exist.
-
User Documentation: User Documentation should be available.
-
Operator Documentation: Operator Documentation should be available.
-
Developper Documentation: Developper Documentation should be available.
-
System Properties
-
Constrains
-
Implementation Language: System should be implemented in scripting
language.
-
Modularity: Each tasks should be performed by single program unit.
Design
Design Choises
-
Database Content: There are two parts of the database:
-
Dump (This part is optional. It is not required for succesfull dumps
and restores. It can be used to check the dump content of tapes and it
can be used for recreating of the destroyed or lost database):
-
Items: record of tape of period
-
Attributes:
-
date
-
fileset
-
level: backup level
-
Entity (This part is mandatory. It stores all information needed
for succesfull dumps and backups. It should be backuped itself frequently.
It can be restored from information available from tapes and/or from the
Dump part.):
-
Items:
-
fileset
-
directory of fileset
-
Attributes:
-
dump: connection to Dump database entry
-
children
-
parents
-
place: position of Entity in in original subsystem
-
date
-
period
-
tape
-
record
-
level
-
Database Format: There are several possibilities how to store database
(real database, plane file, directory structure). The directory structure
format seems to satisfy best our requirements. Possibilities of using other
approaches may be added later, including functions making trasformations
between various formats.
The database is structured in following way::
-
Dump:
-
Structure: <period>/<tape>/<record>
-
Attributes:
-
date:<yyyy:mm:dd:hh:mm:ss>
-
fileset:<xxx>
-
level:<aaa[:aaa]>
-
Example:
-
A
-
0
-
fileset:user.hrivnac
-
000
-
date:1997:09:05:02:00:00
-
level:full
-
001
-
date:1997:09:06:02:00:00
-
level:full:first
-
1
-
B
-
Entity:
-
Structure: <fileset>[/<directory>[/<directory>]][/.../<attributes>]
-
Attributes:
-
<period>:<tape>:<record>:<data>:<level>
-
Example:
-
user
-
hrivnac
-
...
-
A:0:001:1997:09:05:02:00:00:full
-
A:3:001:1997:09:06:02:00:00:full:first
-
work
Not all attributes are stored for all Entities. Some attributes may have
different format depending on other attributes. If any entry doesn't contain
any needed attribute, the attribute situated higher in the hierarchy is
used. Non-existence of Entity children doesn't mean that they are not backuped,
it only means that they cannot be recovered as single Entities. As fileset
itself is mapped into directory hierarchy (replacing "." with "/"), system
finds out where real directory starts by the existence of "..." subdirectory.
-
Schema Content:
-
backup:
-
when (what time)
-
what (what entity)
-
how (what level)
-
Schema Format: <cron time> [<fileset> <level>[/<level>]|command]
[# comment]
Schema is formated like standard crontab. It allows using of the
Schema as input to cron for scheduling.
-
Example:
22 2 * * 3 BackupEngine dump user.hrivnac full
0
22 2 * * 4 BackupEngine dump user.hrivnac full:first
0
22 2 * * 5 BackupEngine dump user.hrivnac full:first:second
0
22 2 * * 6 BackupEngine dump user.hrivnac full:first
0
22 2 * * 0 BackupEngine dump user.hrivnac full:first:second
0
22 2 * * 1 BackupEngine dump user.hrivnac full:first
0
22 2 * * 2 BackupEngine dump user.hrivnac full:first:second
0
23 2 * * 4 BackupEngine dump user.rtb
full
1
23 2 * * 5 BackupEngine dump user.rtb
full:first 1
23 2 * * 6 BackupEngine dump user.rtb
full:first:second 1
23 2 * * 0 BackupEngine dump user.rtb
full:first 1
23 2 * * 1 BackupEngine dump user.rtb
full:first:second 1
23 2 * * 2 BackupEngine dump user.rtb
full:first 1
23 2 * * 3 BackupEngine dump user.rtb
full:first:second 1
-
Options:
-
Items:
-
tape: <dev-file>
-
blocksize: <tape block size>
-
Example:
tape: /dev/rmt8
blocksize: 16k
Proccess Decomposition
See StP.
Functional Decomposition
See StP.
Implementation
Implementation Choises
-
Implementation Language: The system will be implemented in Tcl language.
This allows easy access into DCE/DFS functionality and allows later easy
implementation of GUI front-end based on Tk package. As all functions are
totaly independent, any of them can be replaced by function implemented
by any other language (for example Perl).
Examples
Initialisation
-
Initialise.sh:
#!/bin/sh
# Define database and create its structure
ConfigurationManager dataBase < /afs/cern.ch/user/h/hrivnac/work/dce/Backup
# Defines backup schema
ConfigurationManager setSchema < Schema.txt
# Set options
ConfigurationManager setOptions < Options.txt
# Set current period
ConfigurationManager setPeriod A
-
Schema.txt:
22 2 * * 3 BackupEngine dump user.hrivnac full
0
22 2 * * 4 BackupEngine dump user.hrivnac full:first
0
22 2 * * 5 BackupEngine dump user.hrivnac full:first:second
0
22 2 * * 6 BackupEngine dump user.hrivnac full:first
0
22 2 * * 0 BackupEngine dump user.hrivnac full:first:second
0
22 2 * * 1 BackupEngine dump user.hrivnac full:first
0
22 2 * * 2 BackupEngine dump user.hrivnac full:first:second
0
23 2 * * 4 BackupEngine dump user.rtb
full
1
23 2 * * 5 BackupEngine dump user.rtb
full:first 1
23 2 * * 6 BackupEngine dump user.rtb
full:first:second 1
23 2 * * 0 BackupEngine dump user.rtb
full:first 1
23 2 * * 1 BackupEngine dump user.rtb
full:first:second 1
23 2 * * 2 BackupEngine dump user.rtb
full:first 1
23 2 * * 3 BackupEngine dump user.rtb
full:firts:second 1
-
Options.txt:
tape /dev/rmt0
blocksize 16k
Backup+Restore Test
-
Test.sh:
#!/bin/sh
rm -f /.../cern.ch/user/h/hrivnac/test/*
touch /.../cern.ch/user/h/hrivnac/test/A
touch /.../cern.ch/user/h/hrivnac/test/B
BackupEngine dump user.hrivnac full 2
rm -f /.../cern.ch/user/h/hrivnac/test/A
touch /.../cern.ch/user/h/hrivnac/test/C
BackupEngine dump user.hrivnac full:first 2
rm -f /.../cern.ch/user/h/hrivnac/test/*
# Fill proper time here !
BackupEngine restore user.hrivnac <yyyy:mm:dd:hh:mm:ss>
# As a result, files B, C should exist in /.../cern.ch/user/h/hrivnac/test
Project Diary
-
21Jul-25Jul: Initial Case Study and Requirements Definition (version
0.1)
-
General Case Study and URD created.
-
4Aug-6Aug: Initial Design (version 0.1)
-
Database format desided (filesystem).
-
Schema format desided.
-
Proccess and Functional Decomposition done.
-
Implementation languaga chosen (Tcl).
-
Proccess skeletons created.
-
7Aug-8Aug: Initial Design (version 0.2)
-
Period renamed from number lo letter.
-
Updating database from tape added.
-
Links fom Entity database to Dump database replaced by full description.
-
TapeManager proccess added.
-
BackupEngine.certify erased.
-
Schedule reformat to have standard crontab format.
-
1Sep-23Sep: Prototype implememntation (version 0.3)
-
Database handling.
-
Dump to files (full and incremental).
-
Restore from fles (full and incremental).
Project Plan
-
21Jul-25Jul: Initial Case Study and Requirements Definition (version
0.1)
-
4Aug-8Aug: Initial Design (version 0.2)
-
25Aug-29Aug: Full Design (version 0.2)
-
September: Implementation (alpha)
-
October: Full Cycle (beta)
-
November: Full Cycle (version 1.0)
-
December: Deployment.
previous versions: 0.1, 0.2
J.Hrivnac, 6Oct97