What happens to a task if a matching service process crashes?

I’m trying to get a better understanding of temporal’s internals.

If I understand correctly:

  • The history service will place tasks on a “transfer queue”
  • It will push items from this transfer queue to a task queue (matching service), popping the item off the task queue.

My question is, what would happen if, for instance the host of the task queue crashed. How would temporal know this task needs to be retried (given it’s already been popped off the transfer queue).

It is acknowledged to the transfer queue only after a task is delivered to a worker or persisted in the task queue DB.