You are viewing a plain text version of this content. The canonical link for it is here.
Posted to users@activemq.apache.org by Steve Smith <ta...@gmail.com> on 2011/06/01 08:13:19 UTC
KahaDB and backups
Hi,
How does KahaDB work with OS-level backups? Would a DB restored from
tape be recoverable?
On a related note, is it possible to snapshot a KahaDB?
Cheers,
Steve
Re: KahaDB and backups
Posted by Gary Tully <ga...@gmail.com>.
@James, yes it would, what would follow would be normal recovery, same
as on a restart.
On 2 June 2011 09:49, James Green <ja...@gmail.com> wrote:
> +1 for that.
>
> What would happen in a snapshot freeze then restore to the journal file at
> present? Would KahaDB roll back those transactions?
>
> James
>
> On 2 June 2011 00:19, Steve Smith <ta...@gmail.com> wrote:
>
>>
>> A user-space KahaDB snapshotting tool would certainly be useful regardless.
>>
>> Cheers,
>> Steve
>>
>
--
http://fusesource.com
http://blog.garytully.com
Re: KahaDB and backups
Posted by James Green <ja...@gmail.com>.
+1 for that.
What would happen in a snapshot freeze then restore to the journal file at
present? Would KahaDB roll back those transactions?
James
On 2 June 2011 00:19, Steve Smith <ta...@gmail.com> wrote:
>
> A user-space KahaDB snapshotting tool would certainly be useful regardless.
>
> Cheers,
> Steve
>
Re: KahaDB and backups
Posted by Gary Tully <ga...@gmail.com>.
well not quite an atomic write, but as close as one can get with java
io. Batch writes are serialised and followed by an fsync, so the
fsfreeze will either block the next write or the next fsync. Either
way is fine from a consistency point of view. The index is
checkpointed to the journal periodically, so recovery of the index
will at worst be from the last know good state.
look at processQueue in the source
http://svn.apache.org/viewvc/activemq/trunk/kahadb/src/main/java/org/apache/kahadb/journal/DataFileAppender.java?view=markup
On 2 June 2011 00:19, Steve Smith <ta...@gmail.com> wrote:
> On 1 June 2011 19:50, Gary Tully <ga...@gmail.com> wrote:
>> yes, a restored backup would be recoverable.
>>
>> In creating a backup, there may be an issue with the lock file, or
>> with an inuse journal file. The lock file is not important but you
>> would want the latest journal files.
>>
>> Linux will allow you to freeze a filesystem, I guess other os's have
>> similar support.
>> http://rwmj.wordpress.com/2010/06/09/freezing-filesystems/
>>
>> We may want to introduce a way to have activemq freeze the journal,
>> block reads/writes and release open journal and index files for OS's
>> that don't have freeze support.
>
> Thanks Gary.
>
> Based on what you said I'm not sure that fsfreeze will guarantee a
> consistent journal by itself unless the journal is updated in a single
> atomic write. Is this the case?
>
> A user-space KahaDB snapshotting tool would certainly be useful regardless.
>
> Cheers,
> Steve
>
--
http://fusesource.com
http://blog.garytully.com
Re: KahaDB and backups
Posted by Steve Smith <ta...@gmail.com>.
On 1 June 2011 19:50, Gary Tully <ga...@gmail.com> wrote:
> yes, a restored backup would be recoverable.
>
> In creating a backup, there may be an issue with the lock file, or
> with an inuse journal file. The lock file is not important but you
> would want the latest journal files.
>
> Linux will allow you to freeze a filesystem, I guess other os's have
> similar support.
> http://rwmj.wordpress.com/2010/06/09/freezing-filesystems/
>
> We may want to introduce a way to have activemq freeze the journal,
> block reads/writes and release open journal and index files for OS's
> that don't have freeze support.
Thanks Gary.
Based on what you said I'm not sure that fsfreeze will guarantee a
consistent journal by itself unless the journal is updated in a single
atomic write. Is this the case?
A user-space KahaDB snapshotting tool would certainly be useful regardless.
Cheers,
Steve
Re: KahaDB and backups
Posted by Gary Tully <ga...@gmail.com>.
yes, a restored backup would be recoverable.
In creating a backup, there may be an issue with the lock file, or
with an inuse journal file. The lock file is not important but you
would want the latest journal files.
Linux will allow you to freeze a filesystem, I guess other os's have
similar support.
http://rwmj.wordpress.com/2010/06/09/freezing-filesystems/
We may want to introduce a way to have activemq freeze the journal,
block reads/writes and release open journal and index files for OS's
that don't have freeze support.
On 1 June 2011 07:13, Steve Smith <ta...@gmail.com> wrote:
> Hi,
>
> How does KahaDB work with OS-level backups? Would a DB restored from
> tape be recoverable?
>
> On a related note, is it possible to snapshot a KahaDB?
>
> Cheers,
> Steve
>
--
http://fusesource.com
http://blog.garytully.com