<p>I need synchronous replication over network, but with one strict rule - if DRBD says something is written, it should already be written to both nodes. When secondary is down, and DRBD is still writing to the primary - that is not really synchronous replication. That behaviour makes it asynchronous, because actual write to the secondary node is delayed.<br>
<br>In general, I want to ensure that when database transaction is commited, the data rests on both nodes. If secondary is unavailable, transaction should be rolled back.</p>
<p>Thanks,<br>Yuri.</p>
<div class="gmail_quote">On 19 March 2010 14:15, Digimer <span dir="ltr"><<a href="mailto:linux@alteeve.com">linux@alteeve.com</a>></span> wrote:<br>
<blockquote style="BORDER-LEFT: #ccc 1px solid; MARGIN: 0px 0px 0px 0.8ex; PADDING-LEFT: 1ex" class="gmail_quote">
<div>
<div></div>
<div class="h5">On 10-03-17 06:35 AM, Yuri Ushakov wrote:<br>
<blockquote style="BORDER-LEFT: #ccc 1px solid; MARGIN: 0px 0px 0px 0.8ex; PADDING-LEFT: 1ex" class="gmail_quote">Hello,<br><br>Is it possible to block write to primary node when secondary is not<br>available?<br><br>That is, suppose PostgreSQL asks the filesystem to write some bytes. I'd<br>
like drbd to reply with "write OK" *only* if the data is written to both<br>nodes. If secondary is unavailable because of network error, reply<br>should be "not written".<br><br>What I understood from reading the docs is that unavailable secondary is<br>
considered non-critical, and drbd continues writing to primary.<br><br>Tested that as well - drbdadm disconnect resource, and primary can still<br>write to mounted device.<br><br>Can this behaviour be changed?<br><br>Thanks for help,<br>
Yuri.<br></blockquote><br></div></div>That would largely defeat the purpose of DRBD. When the second node disappears, the remaining node gets a "dirty" inode list in memory. When the node returns, it knows exactly what needs to be updated and syncs the missing data. This sync operation brings the other node back to being identical to the good node.<br>
<br>What, exactly, are you trying to accomplish?<br><font color="#888888"><br>-- <br>Digimer<br>E-Mail: <a href="mailto:linux@alteeve.com" target="_blank">linux@alteeve.com</a><br>AN!Whitepapers: <a href="http://alteeve.com/" target="_blank">http://alteeve.com</a><br>
Node Assassin: <a href="http://nodeassassin.org/" target="_blank">http://nodeassassin.org</a><br></font></blockquote></div><br>