[Date Prev][Date Next] [Chronological] [Thread] [Top]

Re: Is putting slapd into read-only mode sufficient for backups?

On Fri, Feb 10, 2012 at 12:00:29PM -0800, Philip Guenther wrote:
> The optimized procedure that I worked out with Sleepycat's help (for a 
> completely different program, but using the "transaction data store") was 
> this:

I'm exploring implementing these steps, but I'm running into some

If you're willing to discuss this in any better detail (or even
better, provide some script that encapsulates these steps), that'd
be great.

For example:

- In step 3, I'm to 'take note' of the LSN (log sequence number).
  In my test environment, your awk scripts yields '1/456298', as a
  matter of example.  But, I don't see where in these steps, as an
  implementer, that I ever actually act on this data.

  Am I, in step 6, re-deriving the LSN, to see if they differ?

- In step 6, you say 'the database is marked [...]'.  How do I mark
  the database?  Or is this effect implicitly handled by the backend
  as it manages checkpoints and transaction logs?

- In step 7, you say 'log files ... are marked in the backup [...]'.
  What sort of mark do I make so they are not involved in a normal
  backup, but are available if a catastrophic backup if necessary?
  (Does this play into the how the database is marked in step 6?)

> **      Backing up the database environment is done with the following
> **      steps:
> **      0) all txn log files except the current one are copied to
> **         the backup
> **      1) a checkpoint is taken
> **      2) the list of txn log files that are no longer needed for
> **         recovery or txn_abort is obtained
> **      3) the LSN of the most recent checkpoint is noted
> **      4) all the database table files, including queue extents,
> **         are copied to the backup
> **      5) all the txn log files that were not copied in step (0)
> **         are copied to the backup
> **      6) if a checkpoint has *not* taken place since step (3),
> **         then the database is marked as not needing catastrophic
> **         recovery when restored
> **      7) if the list from step (2) is not empty, then those txn
> **         log files are removed from the active database environment
> **         and are marked in the backup as unnecessary for normal
> **         restoration


> For those trying to script this, you can get the LSN of the most recent
> checkpoint with
> 	db_stat -t | awk '$2 ~ /^File\/offset/{print $1; exit}'
> Philip Guenther

Brian Reichert				<reichert@numachi.com>
BSD admin/developer at large