<div dir="ltr">Looking at the Task model, I noticed that it has a foreign key to Worker. That's useful. But because the default on_delete policy is "CASCADE", if the worker gets deleted (such as when it simply shuts down or gets restarted), so will the task record. That's not desirable, because we want to keep task history around.<div><br></div><div><a href="https://github.com/pulp/pulp/blob/02bd7eb1/app/pulp/app/models/task.py#L129">https://github.com/pulp/pulp/blob/02bd7eb1/app/pulp/app/models/task.py#L129</a><br><div><br></div><div>Options:</div><div>- We could set the policy to SET_NULL. When the worker entry gets deleted, the task would simply lose its record of which worker it ran on.</div><div>- We could change this to a TextField and just capture the name of the worker. This would have more long-term value in case someone wants to know what host and process ran a task.</div><div><br></div><div>Given how thin the Worker model is, I don't anticipate that someone looking at a task would want dig into the worker entry to know anything else besides the name. So capturing that directly on the Task model would likely suffice.</div><div><br></div><div>Or we could add a "worker_name" field for posterity and keep the ForeignKey, giving us the best of both worlds.</div><div><br></div><div>Thoughts? Other ideas?</div><div><br></div><div>Michael</div></div></div>