Back Midas Rome Roody Rootana
  Midas DAQ System  Not logged in ELOG logo
Entry  07 Jan 2008, Stefan Ritt, Info, Roll-back for history sytem added 
    Reply  13 Feb 2008, Konstantin Olchanski, Info, Roll-back for history sytem added 
       Reply  13 Feb 2008, Stefan Ritt, Info, Roll-back for history sytem added 
          Reply  28 May 2008, Konstantin Olchanski, Info, Roll-back for history sytem added 
Message ID: 419     Entry time: 07 Jan 2008     Reply to this: 429
Author: Stefan Ritt 
Topic: Info 
Subject: Roll-back for history sytem added 
The midas history system always had the problem that the database can get
corrupted if the disk gets full where the history records (*.hst & *.idx) are
stored. This can happen if a history event can only be written partially on the
almost full disk. If later some space is freed up (by deleting other files), the
writing continues at the old position, leaving the partial event in the data
base. In that case the whole history data of the current day cannot be read
because it is corrupted.

To solve the problem, a roll-back system has been implemented in the
hs_write_event() function. If an event cannot be written fully, the history file
is restored to the old state, so the partial event is removed from the end of
the file via truncation. This way only the data which could not be written to
the disk is missing in the history file, but the other data from that day is
still valid and readable. The change has been committed in revision 4107.
ELOG V3.1.4-2e1708b5