<div dir="ltr"><div>Thanks Ben for your feedbacks.</div><div><br></div><div>I already tried to follow the `remove_external_lock_file` few months ago, but unfortunately, I don't think we can goes like this with Cinder... <br></div><div><br></div><div>As Gorka has explained to me few months ago:</div><div><br></div><div>> Those are not the only type of locks we use in Cinder.  Those are the<br>
> ones we call "Global locks" and use TooZ so the DLM can be configured<br>
> for Cinder Active-Active.<br>
><br>> We also use Oslo's synchronized locks.<br>
><br>
> More information is available in the Cinder HA dev ref I wrote last<br>
> year.  It has a section dedicated to the topic of mutual exclusion and<br>
> the 4 types we currently have in Cinder [1]:<br>
><br>
> - Database locking using resource states.<br>
> - Process locks.<br>
> - Node locks.<br>
> - Global locks.<br>
><br>> As for calling the remove_external_lock_file_with_prefix directly on<br>
> delete, I don't think that's something we can do, as the locks may still<br>
> be in use. Example:<br>
><br>
> - Start deleting volume -> get lock<br>
> - Try to clone volume -> wait for lock<br>
> - Finish deleting volume -> release and delete lock<br>
> - Cloning recreates the lock when acquiring it<br>
> - Cloning fails because the volume no longer exists but leaves the lock</div><div><br></div><div>So the Cinder workflow and mechanisms seems to definitively forbid to us the possibility to use the remove features of oslo.concurrency...</div><div><br></div><div>Also like discussed on the review (<a href="https://review.opendev.org/#/c/688413">https://review.opendev.org/#/c/688413</a>), this issue can't be fixed in the underlying libraries, and I think that if we want to fix that on stable branches then Cinder need to address it directly by adding some piece of code who will be triggered if needed and in a safely manner, in other words, only Cinder can really address it and remove safely these file.</div><div><br></div><div>See the discussion extract on the review (<a href="https://review.opendev.org/#/c/688413">https://review.opendev.org/#/c/688413</a>):</div><div><br></div><div> > Thanks Gorka for your feedback, then in view of all the discussions<br> > about this topic I suppose only Cinder can really address it safely<br> > on stable branches.<br> > <br> > > It is not a safe assumption that *-delete_volume file locks can be<br> > > removed just because they have not been used in a couple of days.<br> > > A new volume clone could come in that would use it and then we<br> > > could have a race condition if the cron job was running.<br> > ><br> > > The only way to be sure that it can be removed is checking in the<br> > > Cinder DB and making sure that the volume has been deleted or it<br> > > doesn't even exist (DB has been purged).<br> > ><br> > > Same thing with detach_volume, delete_snapshot, and those that are<br> > > directly volume ids locks.<br> > <br> > I definitely think that it can't be fixed in the underlying<br> > libraries like Eric has suggested [1], indeed, as you has explained<br> > only Cinder can know if a lock file can be removed safely.<br> > <br> > > In my opinion the fix should be done in fasteners, or we should add<br> > > code in Cinder that cleans up all locks related to a volume or<br> > > snapshot when this one is deleted.<br> > <br> > I agree the most better solution is to fix the root cause and so to<br> > fix fasteners, but I don't think it's can be backported to stable<br> > branches because we will need to bump a requirement version on<br> > stable branche in this case and also because it'll introduce new<br> > features, so I guess Cinder need to add some code to remove these<br> > files and possibly backport it to stable branches.<br> > <br> > [1] <a href="http://lists.openstack.org/pipermail/openstack-discuss/2019-September/009563.html">http://lists.openstack.org/pipermail/openstack-discuss/2019-September/009563.html</a></div><div><br></div><div><div>The Fasteners fix IMHO can only be used by future versions of openstack, due to the version bump and due to the new features added. I think that it could be available only from the ussuri or future cycle like V.</div></div><div><br></div><div>The main goal of the cron approach was to definitively avoid to unearth this topic each 6 months, try to address it on stable branches, and try to take care of the file system usage even if it's a theoretical issue, but by getting feedbacks from the Cinder team and their warnings I don't think that this track is still followable.</div><div><br></div><div><span class="gmail-tlid-translation gmail-translation" lang="en"><span title="" class="gmail-">Definitely, this is not an oslo.concurrency bug.</span></span> Anyway your proposed "Administrator Guide" is a must to have, to track things in one place, inform users and avoid to spend time to explain the same things again and again about this topic... so it's worth-it. I'll review it and propose my related knowledge on this topic. oslo.concurrency can't address this safely because we risk to introduce race conditions and worse situations than the leftover lock files.</div><div><br></div><div>So, due to all these elements, only cinder can address it for the moment and for fix that on stable branches too.</div></div><br><div class="gmail_quote"><div dir="ltr" class="gmail_attr">Le mer. 16 oct. 2019 à 00:15, Ben Nemec <<a href="mailto:openstack@nemebean.com" target="_blank">openstack@nemebean.com</a>> a écrit :<br></div><blockquote class="gmail_quote" style="margin:0px 0px 0px 0.8ex;border-left:1px solid rgb(204,204,204);padding-left:1ex">In the interest of not having to start this discussion from scratch <br>
every time, I've done a bit of a brain dump into <br>
<a href="https://review.opendev.org/#/c/688825/" rel="noreferrer" target="_blank">https://review.opendev.org/#/c/688825/</a> that covers why things are the <br>
way they are and what we recommend people do about it. Please take a <br>
look and let me know if you see any issues with it.<br>
<br>
Thanks.<br>
<br>
-Ben<br>
</blockquote></div><br clear="all"><br>-- <br><div dir="ltr"><div dir="ltr"><div><div dir="ltr"><div><div dir="ltr"><div><div dir="ltr"><div><div dir="ltr"><div><div dir="ltr"><div>Hervé Beraud</div><div>Senior Software Engineer<br></div><div>Red Hat - Openstack Oslo</div><div>irc: hberaud</div><div>-----BEGIN PGP SIGNATURE-----<br><br>wsFcBAABCAAQBQJb4AwCCRAHwXRBNkGNegAALSkQAHrotwCiL3VMwDR0vcja10Q+<br>Kf31yCutl5bAlS7tOKpPQ9XN4oC0ZSThyNNFVrg8ail0SczHXsC4rOrsPblgGRN+<br>RQLoCm2eO1AkB0ubCYLaq0XqSaO+Uk81QxAPkyPCEGT6SRxXr2lhADK0T86kBnMP<br>F8RvGolu3EFjlqCVgeOZaR51PqwUlEhZXZuuNKrWZXg/oRiY4811GmnvzmUhgK5G<br>5+f8mUg74hfjDbR2VhjTeaLKp0PhskjOIKY3vqHXofLuaqFDD+WrAy/NgDGvN22g<br>glGfj472T3xyHnUzM8ILgAGSghfzZF5Skj2qEeci9cB6K3Hm3osj+PbvfsXE/7Kw<br>m/xtm+FjnaywZEv54uCmVIzQsRIm1qJscu20Qw6Q0UiPpDFqD7O6tWSRKdX11UTZ<br>hwVQTMh9AKQDBEh2W9nnFi9kzSSNu4OQ1dRMcYHWfd9BEkccezxHwUM4Xyov5Fe0<br>qnbfzTB1tYkjU78loMWFaLa00ftSxP/DtQ//iYVyfVNfcCwfDszXLOqlkvGmY1/Y<br>F1ON0ONekDZkGJsDoS6QdiUSn8RZ2mHArGEWMV00EV5DCIbCXRvywXV43ckx8Z+3<br>B8qUJhBqJ8RS2F+vTs3DTaXqcktgJ4UkhYC2c1gImcPRyGrK9VY0sCT+1iA+wp/O<br>v6rDpkeNksZ9fFSyoY2o<br>=ECSj<br>-----END PGP SIGNATURE-----<br><br></div></div></div></div></div></div></div></div></div></div></div></div></div>