<div style="line-height:1.7;color:#000000;font-size:14px;font-family:Arial"><div><span style="font-size: 18px;"><b>Hi everyone,<br></b></span><span style="font-size: 16px;">I have a question about removing the primary node with DRBD9.<br>"Is it normal that we only got 20% success rate of removing the primary node?"</span></div><div><ul><li><span style="color: rgb(255, 0, 0);">Version of DRBD kernel source is the newest version(9.0.4-1).Version of DRBD utils is 8.9.6.</span></li></ul></div><span style="font-size: 18px;"><b>Description:</b></span><br>&nbsp;&nbsp;&nbsp; 3 nodes, one of the nodes is primary,disk state is UpToDate.<br>&nbsp;&nbsp;&nbsp; I got an error message 'State change failed: (-2) Need access to UpToDate data' when executing the command 'drbdadm down &lt;res-name&gt;' on the primary node.<br>&nbsp;&nbsp;&nbsp; After excuting the command for the first time, the status of the primary node is the following:<br>&nbsp;&nbsp;&nbsp; # drbdadm status r0<br>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; r0 role:Secondary<br>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; disk:UpToDate<br>&nbsp;&nbsp;&nbsp; After executing the command for the second time,the status of the primary node is empty, then the primary node is removed successfully the time.<br>&nbsp;&nbsp;&nbsp; # drbdadm status r0<br>&nbsp;&nbsp;&nbsp; &lt;NOTHING TO PRINT&gt;.<br><br><span style="font-size: 18px;"><b>Analysis:</b></span><br>&nbsp;&nbsp;&nbsp; We found the following code that report the error.<br>&nbsp;&nbsp;&nbsp; __is_valid_soft_transition()<br>&nbsp;&nbsp;&nbsp; {<br>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; ...<br>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; if (device-&gt;open_ro_cnt &amp;&amp; any_disk_up_to_date[OLD] &amp;&amp; !any_disk_up_to_date[NEW]){<br>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; return SS_NO_UP_TO_DATE_DISK;<br>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; }<br>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; ...<br>&nbsp;&nbsp;&nbsp; }<br>&nbsp;&nbsp; &nbsp;<br>&nbsp;&nbsp;&nbsp; Then we done 20 runs of the test:<br>&nbsp;&nbsp;&nbsp; 1)start the node<br>&nbsp;&nbsp;&nbsp; 2)promote the node<br>&nbsp;&nbsp;&nbsp; 3)remove the node(drbdadm down &lt;res-name&gt;)<br>&nbsp;&nbsp;&nbsp; Only got a 20% success rate of step 3).<br><br>&nbsp;&nbsp;<span style="color: rgb(255, 0, 0);">&nbsp; <b>Fail happens:</b></span><br>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; drbd_open£¨device-&gt;open_ro_cnt is set to non-zero£©--&gt;if condition is satisfied--&gt;drbd_release£¨device-&gt;open_ro_cnt is set to zero£©<br>&nbsp;&nbsp;&nbsp; <span style="background-color: rgb(255, 255, 255); color: rgb(0, 128, 0);"><b>Success happends:</b></span><br>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; drbd_open£¨device-&gt;open_ro_cnt is set to non-zero£©--&gt;drbd_release£¨device-&gt;open_ro_cnt is set to zero£©--&gt;if condition is not satisfied</div><br><br><span title="neteasefooter"><p>&nbsp;</p></span>