[Date Prev][Date Next]   [Thread Prev][Thread Next]   [Thread Index] [Date Index] [Author Index]

Re: Distinct transactions



Folks:

Thanks for the improvements.  To be clear, the new process is:

(1) copy current config file to "new"
(2) modify new file to desired state
(3) hard link current config to "old"
(4) move new file to current file.

Using this approach, I think Andreas is suggesting that if the system
power-cycles, there is no recovery process needed.  The current config file is
always correct.  If the system power cycles before (4) is completed, then the
changes in process are lost.  If (4) was executed, then all the changes to the
system have been journaled and the new config file is as desired.

If the system fails, it might leave a "new" file or a "old" file.  I think I
need to add in removing these, if they exist, as part of this process.  So, I
think I get:

(1) remove "new" if in existance
(2) copy "current" to "new"
(3) modify "new"
(4) remove "old" if in existance
(5) hard link "current" to "old"
(6) move "new" to "current"


I figured I'd leave "old" around as a backup in case the configuration change
process failed (not a journaling failure, but a user failure) and we want to
see the previous configuration.


Does this approach require full data and metadata journaling, or just
"ordered" journaling?

Thanks,

Charlie





Nigel Metheringham wrote:

> On 14 Jun 2001 18:17:34 -0600, Andreas Dilger wrote:
> > If you are doing journalling, I would propose the following:
> > 1) copy config to new file
> > 2) modify new file
> > 3) copy original config to backup
> > 4) mv modified file to replace original
> >
> > The reason for doing this is that at no time will you NOT have a valid
> > config file in place.  One mv is guaranteed atomic, whereas two are not.
>
> To pick a minor nit, you can do this
> a little more efficiently by making
> step #3 a (hard) link of original
> config to backup.
>
>         Nigel.
> --
> [ Nigel Metheringham           Nigel Metheringham InTechnology co uk ]
> [ Phone: +44 1423 850000                         Fax +44 1423 858866 ]
> [ - Comments in this message are my own and not ITO opinion/policy - ]
> [ ----- Security is not an add-on -- security is a way of life ----- ]
>
> _______________________________________________
> Ext3-users mailing list
> Ext3-users redhat com
> https://listman.redhat.com/mailman/listinfo/ext3-users





[Date Prev][Date Next]   [Thread Prev][Thread Next]   [Thread Index] [Date Index] [Author Index]