<html><head><meta http-equiv="content-type" content="text/html; charset=utf-8"></head><body dir="auto"><div dir="ltr"><span></span></div><div dir="ltr"><meta http-equiv="content-type" content="text/html; charset=utf-8"><div dir="ltr"><span></span></div><div dir="ltr"><div dir="ltr"><div dir="ltr"><p class="MsoNormal" style="font-size:medium;color:rgb(0,0,0);margin:0cm 0cm 0.0001pt;font-family:Calibri,sans-serif"><span style="font-size:11pt">Hi Guys<span></span></span></p><p class="MsoNormal" style="font-size:medium;color:rgb(0,0,0);margin:0cm 0cm 0.0001pt;font-family:Calibri,sans-serif"><span style="font-size:11pt"><span> </span></span></p><p class="MsoNormal" style="font-size:medium;color:rgb(0,0,0);margin:0cm 0cm 0.0001pt;font-family:Calibri,sans-serif"><span style="font-size:11pt">Happy new year!<span></span></span></p><p class="MsoNormal" style="font-size:medium;color:rgb(0,0,0);margin:0cm 0cm 0.0001pt;font-family:Calibri,sans-serif"><span style="font-size:11pt"><span> </span></span></p><p class="MsoNormal" style="font-size:medium;color:rgb(0,0,0);margin:0cm 0cm 0.0001pt;font-family:Calibri,sans-serif"><span style="font-size:11pt">I would like to have two volumes (say /dev/data and /dev/binlog) which are used by the same application to be synchronized from my primary node to the other node (bin logs and data dir of MySQL). In DRBD docs it says that resource is a replication group containing multiple volumes and “</span><b><span style="font-family:Arial,sans-serif;color:rgb(34,34,34)">DRBD</span></b><span style="font-family:Arial,sans-serif;color:rgb(34,34,34)"> ensures write fidelity across all </span><b><span style="font-family:Arial,sans-serif;color:rgb(34,34,34)">volumes</span></b><span style="font-family:Arial,sans-serif;color:rgb(34,34,34)"> in the </span><b><span style="font-family:Arial,sans-serif;color:rgb(34,34,34)">resource</span></b><span style="font-family:Arial,sans-serif;color:rgb(34,34,34)">.</span><span style="font-size:11pt">”. </span></p><p class="MsoNormal" style="font-size:medium;color:rgb(0,0,0);margin:0cm 0cm 0.0001pt;font-family:Calibri,sans-serif"><span style="font-size:11pt">MySQL writes data to bin log and data log volumes and data dir contains snapshot while binlog contains dirty segments. There is a relation between the two - binlogs periodically merged back to data volume and purged, so to recover on the other side data volume must contain recent enough snapshot such that binlogs can be applied on top of it.</span></p><p class="MsoNormal" style="font-size:medium;color:rgb(0,0,0);margin:0cm 0cm 0.0001pt;font-family:Calibri,sans-serif"><span style="font-size:11pt">Following that I need two volumes to maintain write causality and be replicated strictly together – i.e. avoid situation when one volume lags or doesn’t replicate while the other one does, otherwise when I failover on the other side I will observe inconsistent picture. </span></p><p class="MsoNormal" style="font-size:medium;color:rgb(0,0,0);margin:0cm 0cm 0.0001pt;font-family:Calibri,sans-serif"><span style="font-size:11pt"><br></span></p><p class="MsoNormal" style="font-size:medium;color:rgb(0,0,0);margin:0cm 0cm 0.0001pt;font-family:Calibri,sans-serif"><span style="font-size:11pt">I put the following configuration to DRBD:</span></p><p class="MsoNormal" style="font-size:medium;color:rgb(0,0,0);margin:0cm 0cm 0.0001pt;font-family:Calibri,sans-serif"><span style="font-size:11pt"><br></span></p><p class="MsoNormal" style="font-size:medium;color:rgb(0,0,0);margin:0cm 0cm 0.0001pt;font-family:Calibri,sans-serif"><span style="font-size:11pt">resource mysql_resource {<span></span></span></p><p class="MsoNormal" style="font-size:medium;color:rgb(0,0,0);margin:0cm 0cm 0.0001pt;font-family:Calibri,sans-serif"><span style="font-size:11pt"> startup {<span></span></span></p><p class="MsoNormal" style="font-size:medium;color:rgb(0,0,0);margin:0cm 0cm 0.0001pt;font-family:Calibri,sans-serif"><span style="font-size:11pt"> wfc-timeout 1;<span></span></span></p><p class="MsoNormal" style="font-size:medium;color:rgb(0,0,0);margin:0cm 0cm 0.0001pt;font-family:Calibri,sans-serif"><span style="font-size:11pt"> }<span></span></span></p><p class="MsoNormal" style="font-size:medium;color:rgb(0,0,0);margin:0cm 0cm 0.0001pt;font-family:Calibri,sans-serif"><span style="font-size:11pt"> disk {<span></span></span></p><p class="MsoNormal" style="font-size:medium;color:rgb(0,0,0);margin:0cm 0cm 0.0001pt;font-family:Calibri,sans-serif"><span style="font-size:11pt"> no-disk-flushes;<span></span></span></p><p class="MsoNormal" style="font-size:medium;color:rgb(0,0,0);margin:0cm 0cm 0.0001pt;font-family:Calibri,sans-serif"><span style="font-size:11pt"> no-md-flushes;<span></span></span></p><p class="MsoNormal" style="font-size:medium;color:rgb(0,0,0);margin:0cm 0cm 0.0001pt;font-family:Calibri,sans-serif"><span style="font-size:11pt"> fencing resource-and-stonith;<span></span></span></p><p class="MsoNormal" style="font-size:medium;color:rgb(0,0,0);margin:0cm 0cm 0.0001pt;font-family:Calibri,sans-serif"><span style="font-size:11pt"> on-io-error call-local-io-error;<span></span></span></p><p class="MsoNormal" style="font-size:medium;color:rgb(0,0,0);margin:0cm 0cm 0.0001pt;font-family:Calibri,sans-serif"><span style="font-size:11pt"> disk-timeout 0;<span></span></span></p><p class="MsoNormal" style="font-size:medium;color:rgb(0,0,0);margin:0cm 0cm 0.0001pt;font-family:Calibri,sans-serif"><span style="font-size:11pt"> }<span></span></span></p><p class="MsoNormal" style="font-size:medium;color:rgb(0,0,0);margin:0cm 0cm 0.0001pt;font-family:Calibri,sans-serif"><span style="font-size:11pt"> volume 0 {<span></span></span></p><p class="MsoNormal" style="font-size:medium;color:rgb(0,0,0);margin:0cm 0cm 0.0001pt;font-family:Calibri,sans-serif"><span style="font-size:11pt"> device /dev/drbd1;<span></span></span></p><p class="MsoNormal" style="font-size:medium;color:rgb(0,0,0);margin:0cm 0cm 0.0001pt;font-family:Calibri,sans-serif"><span style="font-size:11pt"> disk /dev/data;<span></span></span></p><p class="MsoNormal" style="font-size:medium;color:rgb(0,0,0);margin:0cm 0cm 0.0001pt;font-family:Calibri,sans-serif"><span style="font-size:11pt"> meta-disk internal;<span></span></span></p><p class="MsoNormal" style="font-size:medium;color:rgb(0,0,0);margin:0cm 0cm 0.0001pt;font-family:Calibri,sans-serif"><span style="font-size:11pt"> }<span></span></span></p><p class="MsoNormal" style="font-size:medium;color:rgb(0,0,0);margin:0cm 0cm 0.0001pt;font-family:Calibri,sans-serif"><span style="font-size:11pt"> volume 1 {<span></span></span></p><p class="MsoNormal" style="font-size:medium;color:rgb(0,0,0);margin:0cm 0cm 0.0001pt;font-family:Calibri,sans-serif"><span style="font-size:11pt"> device /dev/drbd2;<span></span></span></p><p class="MsoNormal" style="font-size:medium;color:rgb(0,0,0);margin:0cm 0cm 0.0001pt;font-family:Calibri,sans-serif"><span style="font-size:11pt"> disk /dev/binlog;<span></span></span></p><p class="MsoNormal" style="font-size:medium;color:rgb(0,0,0);margin:0cm 0cm 0.0001pt;font-family:Calibri,sans-serif"><span style="font-size:11pt"> meta-disk internal;<span></span></span></p><p class="MsoNormal" style="font-size:medium;color:rgb(0,0,0);margin:0cm 0cm 0.0001pt;font-family:Calibri,sans-serif"><span style="font-size:11pt"> }<span></span></span></p><p class="MsoNormal" style="font-size:medium;color:rgb(0,0,0);margin:0cm 0cm 0.0001pt;font-family:Calibri,sans-serif"><span style="font-size:11pt"><span> </span></span></p><p class="MsoNormal" style="font-size:medium;color:rgb(0,0,0);margin:0cm 0cm 0.0001pt;font-family:Calibri,sans-serif"><span style="font-size:11pt"> on ip-10-15-0-135 {<span></span></span></p><p class="MsoNormal" style="font-size:medium;color:rgb(0,0,0);margin:0cm 0cm 0.0001pt;font-family:Calibri,sans-serif"><span style="font-size:11pt"> address <a href="http://10.15.0.135:1120">10.15.0.135:1120</a>;<span></span></span></p><p class="MsoNormal" style="font-size:medium;color:rgb(0,0,0);margin:0cm 0cm 0.0001pt;font-family:Calibri,sans-serif"><span style="font-size:11pt"> }<span></span></span></p><p class="MsoNormal" style="font-size:medium;color:rgb(0,0,0);margin:0cm 0cm 0.0001pt;font-family:Calibri,sans-serif"><span style="font-size:11pt"> on peer-host {<span></span></span></p><p class="MsoNormal" style="font-size:medium;color:rgb(0,0,0);margin:0cm 0cm 0.0001pt;font-family:Calibri,sans-serif"><span style="font-size:11pt"> address <a href="http://10.15.1.61:1120">10.15.1.61:1120</a>;<span></span></span></p><p class="MsoNormal" style="font-size:medium;color:rgb(0,0,0);margin:0cm 0cm 0.0001pt;font-family:Calibri,sans-serif"><span style="font-size:11pt"> }<span></span></span></p><p class="MsoNormal" style="font-size:medium;color:rgb(0,0,0);margin:0cm 0cm 0.0001pt;font-family:Calibri,sans-serif"><span style="font-size:11pt">}<span></span></span></p><p class="MsoNormal" style="font-size:medium;color:rgb(0,0,0);margin:0cm 0cm 0.0001pt;font-family:Calibri,sans-serif"><span style="font-size:11pt"><span> </span></span></p><p class="MsoNormal" style="font-size:medium;color:rgb(0,0,0);margin:0cm 0cm 0.0001pt;font-family:Calibri,sans-serif"><span style="font-size:11pt">Now two questions:<span></span></span></p><ol start="1" type="1" style="margin-bottom:0cm;color:rgb(0,0,0);font-family:-webkit-standard;margin-top:0cm"><li class="gmail-MsoListParagraph" style="margin:0cm 0cm 0.0001pt;font-size:12pt;font-family:Calibri,sans-serif"><span style="font-size:11pt">Can I achieve such consistency guarantees by using DRBD resource with two volumes?<span></span></span></li><li class="gmail-MsoListParagraph" style="margin:0cm 0cm 0.0001pt;font-size:12pt;font-family:Calibri,sans-serif"><span style="font-size:11pt">If yes and a resource is a single logical replication unit (in a sense of described guarantees), why are GIs different per volume? Can I have situations when only one volume is disconnected or needs to resync? Can I have situations when one volume is Priomary/Secondary while the other is Secondary/Primary?</span></li><li class="gmail-MsoListParagraph" style="margin:0cm 0cm 0.0001pt;font-size:12pt;font-family:Calibri,sans-serif"><span style="font-size:11pt">More generally, what would be the motivation to have volumes grouped into resources if synchronization still happens on volume level? (Or maybe I am confused since documentation does refer to resources being unit of synchronization (like sync bitmask is per reaource), but get/set -gi accepts volume)</span></li></ol><p class="MsoNormal" style="font-size:medium;color:rgb(0,0,0);margin:0cm 0cm 0.0001pt;font-family:Calibri,sans-serif"><span style="font-size:11pt"><span> </span></span></p><p class="MsoNormal" style="font-size:medium;color:rgb(0,0,0);margin:0cm 0cm 0.0001pt;font-family:Calibri,sans-serif"><a name="_MailAutoSig"><b><span lang="EN-US" style="font-size:11pt">Anton Polyakov</span></b></a></p></div></div>
</div></div></body></html>