[Info-Ingres] delete_oldest_ckp deletes two checkpoints
Paul Mason
latepaul at gmail.com
Fri Dec 21 07:01:58 CST 2007
On 21/12/2007, Roy Hann <specially at processed.almost.meat> wrote:
>
> "On Web" <ac297 at dial.pipex.commm> wrote in message
> news:gyNaj.20081$yZ4.12222 at newsfe4-gui.ntli.net...
> > "Martin Bowes" <martin.bowes at ctsu.ox.ac.uk> wrote in message
> > news:mailman.99.1198225954.2388.info-ingres at kettleriverconsulting.com...
> >> Hi Paul
> >>
> >> How can an invalid checkpoint be valuable?
> >
> > It's not, but isn't the user requesting that the oldest be deleted and
> > might reasonably expect that after running the command against three
> > checkpoints, there will be two left afterwards not one?
> >
> > It's really all about the user knowing exactly what will happen
> beforehand
> > when the command is run. The command suggests only one checkpoint will
> be
> > deleted, but one or two, or possibly more checkpoints could be removed
> > after running this command.
> >
> > I am just raising the question - could running this command lose a
> > checkpoint that the DBA needs to keep simply because they haven't
> realised
> > the oldest checkpoint is invalid? It seems a likely scenario given that
> > automated scipts may be involved.
>
> I completely agree.
Whereas I only partly agree ;)
Suppose I like to keep five checkpoints as a matter of
> policy. Initially I do five checkpoints one after another, and thereafter
> my nightly job does one more and uses alterdb to deleted the oldest.
>
> If an invalid checkpoint occurs that gets deleted only because it is
> invalid, I am now down to four. If it happened again, perhaps much later,
> I
> am down to three, and so on. I therefore have to go to the trouble of
> doing
> an otherwise unnecessary extra checkpoint just to get back to the five I
> keep as policy. If the invalid checkpoint were deleted only when it
> became
> the oldest, in the usual way, the problem would automatically go away
> after
> a few days.
To be honest I'm always dubious about this approach.
Over the years I've written many scripts that run, create a logfile and keep
N old logfiles. I have used the approach of 'assume we have N and delete the
oldest' but it's far better to actually count them and make sure you keep N.
That way if I accidentally delete one (or more) they'll re-accumulate
automatically.
Equally here, if it's important to keep N valid checkpoints, I'd want to
actually count the number of checkpoints I have before deleting one. Or at
least check that my latest checkpoint succeeded before deleting the oldest.
Now, due to the difficulty of scripting in Windows, I can understand not
doing this and I can understand why not deleting invalid checkpoints is
useful. But using an invalid checkpoint as a place marker to compensate for
Windows' lack of scripting is a compromise and should be seen as such.
What would be better would be to have an "-delete-old-ckp-keeping N" option.
I prefer this because it's then explicit what you're doing. I mentioned this
to my colleague in engineering who said he'll do it if I raise an internal
issue. Since this is my last day before Christmas I'll do that when I return
in the New Year. I'll keep you posted.
Cheers
--
Paul Mason
-------------- next part --------------
An HTML attachment was scrubbed...
URL: http://www.kettleriverconsulting.com/mailman/private/info-ingres/attachments/20071221/35970f2f/attachment.html
More information about the Info-Ingres
mailing list