Repository navigation
Commit 815063d
authored
Skip retired/lost workers in janitor orphan list (#405)
The janitor's ListOrphanedWorkers query included workers in the retired
and lost states alongside active states. When a worker's owning CP is
expired, retireClaimedWorker re-persists the row with the original
expired CP as owner, so the orphan query keeps re-listing the same row
on every cycle. retireWorkerPod then loops on a 404 from the K8s pod
delete:
Retiring K8s worker. id=685 pod=duckgres-worker-...-685
Failed to delete worker pod. error="pods ... not found"
The original reason for including retired/lost was to let a successor
janitor finish a K8s pod delete that the dying CP didn't complete. That
case is now handled authoritatively by the K8s label-based startup scan
in cleanupOrphanedWorkerPods (4e96d11), so the inclusion is redundant
and harmful.
Excludes WorkerStateRetired and WorkerStateLost from the cleanup states.
First-time orphans still get processed: their state is reserved/idle/
spawning/etc. when the janitor first sees them, transitions to retired
inside retireClaimedWorker, then the next cycle skips the row.
Updates TestListOrphanedAndStuckWorkersPostgres to assert the new
behavior with both retired and lost orphan rows present.1 parent 9164d8e commit 815063d
2 files changed
Lines changed: 23 additions & 10 deletions
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
784 | 784 | | |
785 | 785 | | |
786 | 786 | | |
787 | | - | |
788 | | - | |
789 | | - | |
| 787 | + | |
| 788 | + | |
| 789 | + | |
| 790 | + | |
| 791 | + | |
790 | 792 | | |
791 | 793 | | |
792 | 794 | | |
| |||
797 | 799 | | |
798 | 800 | | |
799 | 801 | | |
800 | | - | |
801 | | - | |
802 | 802 | | |
803 | 803 | | |
804 | 804 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
476 | 476 | | |
477 | 477 | | |
478 | 478 | | |
| 479 | + | |
| 480 | + | |
| 481 | + | |
| 482 | + | |
479 | 483 | | |
480 | 484 | | |
481 | 485 | | |
| |||
488 | 492 | | |
489 | 493 | | |
490 | 494 | | |
| 495 | + | |
| 496 | + | |
| 497 | + | |
| 498 | + | |
| 499 | + | |
| 500 | + | |
| 501 | + | |
| 502 | + | |
| 503 | + | |
| 504 | + | |
| 505 | + | |
| 506 | + | |
491 | 507 | | |
492 | 508 | | |
493 | 509 | | |
| |||
509 | 525 | | |
510 | 526 | | |
511 | 527 | | |
512 | | - | |
513 | | - | |
514 | | - | |
515 | | - | |
516 | | - | |
| 528 | + | |
| 529 | + | |
517 | 530 | | |
518 | 531 | | |
519 | 532 | | |
| |||
0 commit comments