<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.0 TRANSITIONAL//EN">
<HTML>
<HEAD>
  <META HTTP-EQUIV="Content-Type" CONTENT="text/html; CHARSET=UTF-8">
  <META NAME="GENERATOR" CONTENT="GtkHTML/1.0.4">
</HEAD>
<BODY>
On Wed, 2005-03-23 at 10:29, Philipp Reisner wrote:
    <BLOCKQUOTE>
<PRE><FONT COLOR="#737373"><FONT SIZE="3"><I>Am Dienstag, 22. M&#228;rz 2005 17:48 schrieb Filip Sergeys:</FONT></FONT></I>
<FONT COLOR="#737373"><FONT SIZE="3"><I>&gt; Hello,</FONT></FONT></I>
<FONT COLOR="#737373"><FONT SIZE="3"><I>&gt;</FONT></FONT></I>
<FONT COLOR="#737373"><FONT SIZE="3"><I>&gt; Maybe my input can help you convince. Indeed mounting read only does</FONT></FONT></I>
<FONT COLOR="#737373"><FONT SIZE="3"><I>&gt; come in very handy for database logfiles.</FONT></FONT></I>
<FONT COLOR="#737373"><FONT SIZE="3"><I>&gt;</FONT></FONT></I>
<FONT COLOR="#737373"><FONT SIZE="3"><I>&gt; This is the situation:</FONT></FONT></I>
<FONT COLOR="#737373"><FONT SIZE="3"><I>&gt; A masterdatabase which is online</FONT></FONT></I>
<FONT COLOR="#737373"><FONT SIZE="3"><I>&gt; A slavedatabase which is in standby</FONT></FONT></I>
<FONT COLOR="#737373"><FONT SIZE="3"><I>&gt;</FONT></FONT></I>
<FONT COLOR="#737373"><FONT SIZE="3"><I>&gt; In normal operations:</FONT></FONT></I>
<FONT COLOR="#737373"><FONT SIZE="3"><I>&gt; ------------------------</FONT></FONT></I>
<FONT COLOR="#737373"><FONT SIZE="3"><I>&gt; The masterdatabase writes duplexed log files and archived log files to</FONT></FONT></I>
<FONT COLOR="#737373"><FONT SIZE="3"><I>&gt; the primary drbd device.</FONT></FONT></I>
<FONT COLOR="#737373"><FONT SIZE="3"><I>&gt; At night the slavedatabase &quot;wakes up&quot; mounts the secondary drbd device</FONT></FONT></I>
<FONT COLOR="#737373"><FONT SIZE="3"><I>&gt; read only and applies the past 24 hours of changes captured in the</FONT></FONT></I>
<FONT COLOR="#737373"><FONT SIZE="3"><I>&gt; archived and the online redo log files. When done, the database goes</FONT></FONT></I>
<FONT COLOR="#737373"><FONT SIZE="3"><I>&gt; back to standby and the device is umounted.</FONT></FONT></I>
<FONT COLOR="#737373"><FONT SIZE="3"><I>&gt; To be more precise, in reality, I mount the device, copy the changes</FONT></FONT></I>
<FONT COLOR="#737373"><FONT SIZE="3"><I>&gt; since last night to a local device, unmount, and then work with the</FONT></FONT></I>
<FONT COLOR="#737373"><FONT SIZE="3"><I>&gt; local copies. The reason? I don't know how the slavedatabase would react</FONT></FONT></I>
<FONT COLOR="#737373"><FONT SIZE="3"><I>&gt; if the online redologfiles changed will rolling forward.</FONT></FONT></I>
<FONT COLOR="#737373"><FONT SIZE="3"><I>&gt; So far this could also be done with NFS</FONT></FONT></I>
<FONT COLOR="#737373"><FONT SIZE="3"><I>&gt;</FONT></FONT></I>
<FONT COLOR="#737373"><FONT SIZE="3"><I>&gt; When a failure happens on the masterdatabase and it goes down:</FONT></FONT></I>
<FONT COLOR="#737373"><FONT SIZE="3"><I>&gt; ---------------------------------------------------------------------------</FONT></FONT></I>
<FONT COLOR="#737373"><FONT SIZE="3"><I>&gt; the slavedatabase kicks in (via heartbeat) mounts the drbd device in</FONT></FONT></I>
<FONT COLOR="#737373"><FONT SIZE="3"><I>&gt; primary, applies the changes since midnight and fires up in online</FONT></FONT></I>
<FONT COLOR="#737373"><FONT SIZE="3"><I>&gt; state.</FONT></FONT></I>
<FONT COLOR="#737373"><FONT SIZE="3"><I>&gt; This could not be done with NFS because you wouldn't have access</FONT></FONT></I>
<FONT COLOR="#737373"><FONT SIZE="3"><I>&gt; anymore. rsync is not an option either because you need the committed</FONT></FONT></I>
<FONT COLOR="#737373"><FONT SIZE="3"><I>&gt; changes up to the very last second.</FONT></FONT></I>
<FONT COLOR="#737373"><FONT SIZE="3"><I>&gt;</FONT></FONT></I>
<FONT COLOR="#737373"><FONT SIZE="3"><I>&gt; I think this is a very common setup and drbd is a magnificent tool to</FONT></FONT></I>
<FONT COLOR="#737373"><FONT SIZE="3"><I>&gt; reach the goal for this.</FONT></FONT></I>
<FONT COLOR="#737373"><FONT SIZE="3"><I>&gt; So hope this is convincing enough ;)</FONT></FONT></I>
<FONT COLOR="#737373"><FONT SIZE="3"><I>&gt;</FONT></FONT></I>
<FONT COLOR="#737373"><FONT SIZE="3"><I></FONT></FONT></I>
<FONT COLOR="#737373"><FONT SIZE="3"><I>This reasoning is exactly the reason why we prohibit mounting the secondary.</FONT></FONT></I>
<FONT COLOR="#737373"><FONT SIZE="3"><I></FONT></FONT></I>
<FONT COLOR="#737373"><FONT SIZE="3"><I>I assume that you use a filesystem like ext3, XFS or reiserfs.</FONT></FONT></I>
<FONT COLOR="#737373"><FONT SIZE="3"><I>For the short time you mount it on the seconary, the primary may</FONT></FONT></I>
<FONT COLOR="#737373"><FONT SIZE="3"><I>modify it...</FONT></FONT></I>
<FONT COLOR="#737373"><FONT SIZE="3"><I></FONT></FONT></I>
<FONT COLOR="#737373"><FONT SIZE="3"><I>Just consider this... the FS on the secondary reads an inode...,</FONT></FONT></I>
<FONT COLOR="#737373"><FONT SIZE="3"><I>then the FS is modified by the primary, then the FS on the secondary</FONT></FONT></I>
<FONT COLOR="#737373"><FONT SIZE="3"><I>wants to read the data blocks, that are referenced by the inode....</FONT></FONT></I>
<FONT COLOR="#737373"><FONT SIZE="3"><I></FONT></FONT></I>
<FONT COLOR="#737373"><FONT SIZE="3"><I>But in the meantime these data blocks where relocated by the other machine...</FONT></FONT></I>
<FONT COLOR="#737373"><FONT SIZE="3"><I></FONT></FONT></I>
<FONT COLOR="#737373"><FONT SIZE="3"><I>My experiences are:</FONT></FONT></I>
<FONT COLOR="#737373"><FONT SIZE="3"><I> - ext2/ext3 will print some assertions to the kernel log, return an error</FONT></FONT></I>
<FONT COLOR="#737373"><FONT SIZE="3"><I>             to the application that wanted to read the file and continue to</FONT></FONT></I>
<FONT COLOR="#737373"><FONT SIZE="3"><I>             run.</FONT></FONT></I>
<FONT COLOR="#737373"><FONT SIZE="3"><I> - reiserfs&nbsp; will crash the machine.</FONT></FONT></I></PRE>
    </BLOCKQUOTE>
<FONT SIZE="3">That means I have been a lucky bastard the last few months. I use reiserfs ....&nbsp; hmmm, I better a solution quick !</FONT>
<BR>
<FONT SIZE="3">Would a better way be to drbdsetup /dev/nb0 disconnect before mounting read only, do my stuff, unmount, and then run drbdsetup /dev/nb0 net xyz to bring it in secondary state again?</FONT>
    <BLOCKQUOTE>
<PRE><FONT COLOR="#737373"><FONT SIZE="3"><I> - XFS       I do not know.</FONT></FONT></I>
<FONT COLOR="#737373"><FONT SIZE="3"><I></FONT></FONT></I>
<FONT COLOR="#737373"><FONT SIZE="3"><I></FONT></FONT></I>
<FONT COLOR="#737373"><FONT SIZE="3"><I></FONT></FONT></I>
<FONT COLOR="#737373"><FONT SIZE="3"><I>Please hold you feets still until DRBD-0.8 is released. In DRBD-0.8 we</FONT></FONT></I>
<FONT COLOR="#737373"><FONT SIZE="3"><I>will support primary/primary, and with on of OCFS2, openGFS or GFS</FONT></FONT></I>
<FONT COLOR="#737373"><FONT SIZE="3"><I>you will be able to build such a setup.</FONT></FONT></I>
<FONT COLOR="#737373"><FONT SIZE="3"><I></FONT></FONT></I>
<FONT COLOR="#737373"><FONT SIZE="3"><I>-Philipp</FONT></FONT></I>
<FONT COLOR="#737373"><FONT SIZE="3"><I>-- </FONT></FONT></I>
<FONT COLOR="#737373"><FONT SIZE="3"><I>: Dipl-Ing Philipp Reisner                      Tel +43-1-8178292-50 :</FONT></FONT></I>
<FONT COLOR="#737373"><FONT SIZE="3"><I>: LINBIT Information Technologies GmbH          Fax +43-1-8178292-82 :</FONT></FONT></I>
<FONT COLOR="#737373"><FONT SIZE="3"><I>: Sch&#246;nbrunnerstr 244, 1120 Vienna, Austria&nbsp;&nbsp;&nbsp; http://www.linbit.com :</FONT></FONT></I></PRE>
    </BLOCKQUOTE>
<TABLE CELLSPACING="0" CELLPADDING="0" WIDTH="100%">
<TR>
<TD>
<PRE>-- 
*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*
* System Engineer, Verzekeringen NV *
* www.verzekeringen.be              *
* Oostkaai 23 B-2170 Merksem        *
* 03/6416673 - 0477/340942          *
*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*</PRE>
</TD>
</TR>
</TABLE>

</BODY>
</HTML>