Without looking, draw the queue, two workers and the database. Mark where the acknowledgement is lost, then draw where duplicate work is prevented. Next to it, write which operation must be safe to retry and why the queue cannot do it for you.
Then check
Stuck?