On Wed, 29 Aug 2018 at 15:37, Randy Barlow <bowlofeggs@xxxxxxxxxxxxxxxxx> wrote:
On 08/29/2018 03:26 PM, Stephen John Smoogen wrote:
> Can you give me more information on what this will due, what could go
> wrong and how to recover? If not I don't think I can give an answer.
Bodhi has a database model called a Compose, which is used to keep track
of each of its daily compose jobs (formerly called mashes):
https://github.com/fedora-infra/bodhi/blob/3.9.0/bodhi/server/models.py#L3637-L3667
The code snippet I pasted will delete the first Compose object found in
the database. There is currently only one, and it's the one I want to
delete. To be fully honest, my shell snippet was a little lazy in this
way because I could have written a more formal query to target the
specific one, but since there is only one it's pretty easy to just say
"delete it!". I could do this instead actually:
>>> c = m.Compose.query.one()
The original is fine. Thank you for the training. I just wanted to make sure there weren't more objects in the DB, that the query wouldn't give you a random return from a hashtable etc.
+1
That will fail to retrieve it if there's more than one. So I'll do it
that way if I get my +1's, so I can be lazy *and* more precise at the
same time ☺
Since the backend isn't running any composes right now, I don't know of
any particular risk to deleting it. The Compose models are short-lived
objects in the database anyway, as they exist purely to track the state
of those jobs. When the jobs finish successfully, these Compose objects
are deleted. This particular one has stuck around because the previous
job failed. Unfortunately, every single update has been kicked out too,
so I'm not sure what would even happen if we resumed it (which would be
the typical thing to do now). This is why I'd rather just delete it so
bodhi-push can start a new one.
_______________________________________________
infrastructure mailing list -- infrastructure@xxxxxxxxxxxxxxxxxxxxxxx
To unsubscribe send an email to infrastructure-leave@xxxxxxxxxxxxxxxxxxxxxxx
Fedora Code of Conduct: https://getfedora.org/code-of-conduct.html
List Guidelines: https://fedoraproject.org/wiki/Mailing_list_guidelines
List Archives: https://lists.fedoraproject.org/archives/list/infrastructure@xxxxxxxxxxxxxxxxxxxxxxx
Stephen J Smoogen.
_______________________________________________ infrastructure mailing list -- infrastructure@xxxxxxxxxxxxxxxxxxxxxxx To unsubscribe send an email to infrastructure-leave@xxxxxxxxxxxxxxxxxxxxxxx Fedora Code of Conduct: https://getfedora.org/code-of-conduct.html List Guidelines: https://fedoraproject.org/wiki/Mailing_list_guidelines List Archives: https://lists.fedoraproject.org/archives/list/infrastructure@xxxxxxxxxxxxxxxxxxxxxxx