From df98ffb5c59868cfdb852e4e3db06740c085fe8a Mon Sep 17 00:00:00 2001 From: zhangwenjian Date: Sun, 20 Sep 2026 18:31:32 +0800 Subject: [PATCH] =?UTF-8?q?docs=F0=9F=93=9D:=20say=20what=20a=20second=20r?= =?UTF-8?q?eplica=20now=20does=20to=20the=20scheduler?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit The note told the reader the scheduler stood in the way of raising the replica count. It no longer does: one enabled job fires once however many pods there are, a pod that loses the lease stops scheduling, and one that exits hands the lease back rather than making its successor wait it out. The shared log volume still does stand in the way, and that is now the only thing the note asks for before the number goes up. --- scripts/k8s/deploy.yml | 22 ++++++++++------------ 1 file changed, 10 insertions(+), 12 deletions(-) diff --git a/scripts/k8s/deploy.yml b/scripts/k8s/deploy.yml index e9ad5e24..b408fc7e 100644 --- a/scripts/k8s/deploy.yml +++ b/scripts/k8s/deploy.yml @@ -23,20 +23,18 @@ metadata: version: v1 spec: # One replica, and the drain window below buys nothing at one replica: there - # is nowhere to send the traffic this pod stops taking. Raising it needs two - # changes that are not this number: + # is nowhere to send the traffic this pod stops taking. # - # The volume below is shared by every replica, and the log path in - # settings.yml lives on it, so a second pod would append to the same - # rotating file. + # The scheduler no longer stands in the way of raising this. Every pod takes + # a lease row in its own database (sys_job_lease) and only the holder + # registers the jobs, so one enabled job fires once however many pods there + # are; a pod that loses the lease stops scheduling, and one that exits hands + # it back so a successor starts without waiting out the lease. See #915. # - # The job scheduler is per process while its handle on a job is one shared - # column. Startup runs `UPDATE sys_job SET entry_id = 0 WHERE entry_id > 0` - # across the whole table (app/jobs/jobbase.go), so a second pod erases the - # first pod's ids and writes its own, and every pod registers the whole - # enabled list in its own scheduler. Neither symptom logs anything: an - # enabled job fires once per pod, and stopping one from the UI removes an - # entry from the wrong process and still answers 200. See #915. + # What still does stand in the way: the volume below is shared by every + # replica, and the log path in settings.yml lives on it, so a second pod + # appends to the same rotating file. Give each replica its own log + # destination before raising this. replicas: 1 selector: matchLabels: