0

A bit unclear sentence in the doco:

Note that, although rare, more than one Pod could be started for the same index, but only one of them will count towards the completion count.

So say it happens, there are two pods in an Indexed job with the same index. Now, one of them is failed (the restartPolicy = "Never"), another succeed. Assume that all other pods succeed. Will the job fail overall? Or maybe it depends on which one of those sharing the same index was first - the succeeded or the failed one? Or is it totally indeterminate?

Mikha
  • 491
  • 2
  • 13

1 Answers1

1

The first sentence is important:

The Job is considered complete when there is one successfully completed Pod for each index.

There can be duplicated index but for each index, only one (the one that reached Completed first) will be counted for spec.completions.

gohm'c
  • 13,492
  • 1
  • 9
  • 16
  • Ok thanks!! So even if one of the "twin" pods has failed, the job still might be complete if another twin succeeds? So potentially it's possible to have a Complete job with a failed pod, even when the restartPolicy="Never" and backoffLimit=0 ?? – Mikha May 26 '22 at 07:59
  • `"twin" pods has failed` - if you meant none of the pods with a particular index has completed , then the job will fail. The key point is for each index; regardless how many pods are running; there must be one and **only** one that is completed in order to be counted as `spec.completions`. Note `restartPolicy` applied to pod only, job is not constraint by this field. – gohm'c May 26 '22 at 08:13
  • Thanks @gohm'c The latter question was about a case when a pod fails, but it happens to be this rare situation when there is another pod succeeded that shares the same index (while backoffLimit says there should be no restarts etc). I understand now that in this case the job will have the status Complete, while there will be a failed pod within it - that's a bit contraintuitive, but oh well. In other words, I should always treat it as that there could be some restarted pods even when backoffLimit=0. Would be better if it's clarified a bit in the official doc, but I think I'm getting it anyway – Mikha May 26 '22 at 09:34