<div dir="ltr"><div><div>+1 to taking an action on this. The SET_NULL approach sounds fine with me for now. It is so simple. It does not help with the later log analysis though which I do think is useful, but maybe not something we need to facilitate with the MVP.<br><br></div>To brainstorm another idea, what if instead of deleting workers, we keep those records for much longer. With the same reasoning as Task, it would be useful to post-mortem analyze when workers are coming on and offline for example. FYI, the Worker table is exclusively managed by pulp_celerybeat. We could introduce a online boolean to the Worker model and update pulp_celerybeat to mark workers as online/offline instead of deleting them. I don't think this would be difficult to do or get right. It would solve the issue of the cascading deletes, provide the Task analysis use case, and provide the Worker analysis use case too. I would rather do this than add an additional field to Task.<br><br></div>I would be fine with either of ^ approaches, but I hope we don't add an additional field to Task. We could use SET_NULL for the 3.0 MVP and save this as a future refactor/bugfix. It's probably a bug for that field to become NULL when a worker is deleted. What do others think about this?<br><div><div><br></div><div>Thanks for bringing his up; we need to take some action.<br><br></div><div>-Brian<br></div><div><br><br></div></div></div><div class="gmail_extra"><br><div class="gmail_quote">On Thu, Nov 17, 2016 at 10:03 AM, Jeff Ortel <span dir="ltr"><<a href="mailto:jortel@redhat.com" target="_blank">jortel@redhat.com</a>></span> wrote:<br><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex"><span class=""><br>
<br>
On 11/16/2016 05:27 PM, Sean Myers wrote:<br>
> On 11/16/2016 05:28 PM, Michael Hrivnak wrote:<br>
>> Options:<br>
>> - We could set the policy to SET_NULL. When the worker entry gets deleted,<br>
>> the task would simply lose its record of which worker it ran on.<br>
><br>
> +1 to this.<br>
</span>+1<br>
<div class="HOEnZb"><div class="h5"><br>
><br>
> Since the worker no longer exists in that scenario, I don't think we lose any<br>
> data there, right? A reference to a nonexistent worker is as good as NULL. Do<br>
> we need to add a task scrubber to find tasks with NULL workers and make sure<br>
> they get reassigned? We could also use SET() here, and pass it a callable that<br>
> sets it to an extant worker pk, but at the moment I think I prefer SET_NULL.<br>
><br>
> ______________________________<wbr>_________________<br>
> Pulp-dev mailing list<br>
> <a href="mailto:Pulp-dev@redhat.com">Pulp-dev@redhat.com</a><br>
> <a href="https://www.redhat.com/mailman/listinfo/pulp-dev" rel="noreferrer" target="_blank">https://www.redhat.com/<wbr>mailman/listinfo/pulp-dev</a><br>
><br>
<br>
</div></div><br>______________________________<wbr>_________________<br>
Pulp-dev mailing list<br>
<a href="mailto:Pulp-dev@redhat.com">Pulp-dev@redhat.com</a><br>
<a href="https://www.redhat.com/mailman/listinfo/pulp-dev" rel="noreferrer" target="_blank">https://www.redhat.com/<wbr>mailman/listinfo/pulp-dev</a><br>
<br></blockquote></div><br></div>