-
Steven Murray authored
The state machine of tape drive in the drive catalogue of the tapeserverd daemon is now the following. Please note that the actual implementation of the state machine is not yet complete. start daemon / ------ send VDQM_UNIT_DOWN ------------------ | INIT |--------------------->| DOWN |<------------------- ------ ------------------ | | | ^ | | | | | | | tpconfig up | tpconfig down | | | | | | start daemon / v | | | send VDQM_UNIT_UP ------------------ | ------------------------>| UP | | ------------------ | | ^ | | | | | vdqm job / | SIGCHLD [success] | | fork | | | | | v | | ------------------ SIGCHLD [fail] | | RUNNING |--------------------| ------------------ | | ^ | | | | | tpconfig down | tpconfig up | | | | v | | ------------------ SIGCHLD | | WAITDOWN |-------------------- ------------------ When the tapeserverd daemon is started, depending on the initial state defined in /etc/castor/TPCONFIG, the daemon sends either a VDQM_UNIT_UP or VDQM_UNIT_DOWN status message to the vdqmd daemon. Once sent the state of the tape drive is either DRIVE_STATE_UP or DRIVE_STATE_DOWN respectively. A tape operator toggles the state of tape drive between DOWN and UP using the tpconfig adminstration tool. The tape daemon can receive a job from the vdqmd daemon when the state of tape drive is DRIVE_STATE_UP. On reception of the job the daemon forks a child process to run a tape mount session. A tape will be mounted and data will be transfered to and/or from that tape during the session. The tape drive is in the DRIVE_STATE_RUNNING state whilst the tape session is running. Once the vdqm job has been carried out, the child process completes and the state of the tape drive either returns to DRIVE_STATE_UP if there were no problems or to DRIVE_STATE_DOWN if there were. If the tape daemon receives a tpconfig down during a tape session, in other words whilst the drive in question is in the DRIVE_STATE_RUNNING state, then the state of the drive is moved to DRIVE_STATE_WAITDOWN. The tape session continues to run in the DRIVE_STATE_WAITDOWN state, however when the tape session is finished the state of the drive is moved to DRIVE_STATE_DOWN.
5e3d60ab