myxce/src
Rongsong Shen fc55994813
fix(bug-1727): 'info worker'/'info resource' double-counted used capacity
repl_info_worker_one()/repl_info_resource_one() (repl_info.c) printed
value=avail+used for a CONSUMABLE resource, on the assumption that
avail_v holds a live "remaining capacity" figure that shrinks as jobs
run. That assumption was false: w->resvals[idx] (and
core->sharedInst[idx] for shared resources) is the resource's STATIC
TOTAL capacity, self-reported by the worker at join/heartbeat time and
never decremented as jobs consume it -- confirmed against the actual
admission-control formula this same field feeds (resource.c's
unsatisfy_(): `total[i] < inuse[i] + uncomitted[i] + wanted[i]` treats
it as a total, not a pre-reduced remaining figure). Printing avail+used
therefore double-counted `used` on top of a value that already
included it.

Live-reproduced against a real 3-node cluster + worker: a fully-packed
22-slot worker showed "value=44.00 used=22.00" instead of the correct
"value=22.00 used=22.00" (22 never-decremented total + 22 used = 44,
matching this bug's mechanism exactly). This was previously
investigated as bug-1727 ("recorded for future investigation only") --
confirmed its hypothesis (a) and closed it here rather than opening a
new entry.

Fixed by printing avail_v as-is (no addition) at both call sites.

Co-Authored-By: Claude Sonnet 5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_019QxaSzHRB7pmYFp4cVnwkA
2026-08-31 04:20:58 +00:00
..
autoscaler support shared libxce(for api server) 2026-01-19 11:02:49 +08:00
configs fix(controller): close 6 data-safety races + apply-pump O(N^2) regression + boot TOCTOU 2026-08-16 10:20:02 +00:00
controller fix(bug-1737): scheduler can never learn a job finished successfully 2026-08-31 04:20:27 +00:00
docs update documents 2026-08-10 17:51:51 +08:00
frontend fix(bug-1731): fire HOOK_DETAIL_JOB_START/JOB_EXIT on WAL apply 2026-08-29 11:29:10 +00:00
include fix(bug-1737): scheduler can never learn a job finished successfully 2026-08-31 04:20:27 +00:00
lib fix(bug-1737): scheduler can never learn a job finished successfully 2026-08-31 04:20:27 +00:00
nixSupport feat(dirty-content-fingerprint): Nix flake computes fingerprint via self.narHash 2026-08-21 04:57:56 +00:00
scheduler fix(bug-1727): 'info worker'/'info resource' double-counted used capacity 2026-08-31 04:20:58 +00:00
schema fix(bug-1737): scheduler can never learn a job finished successfully 2026-08-31 04:20:27 +00:00
tools fix(bug-924): prune stale /tmp test-fixture dirs in xce-build.sh 2026-08-30 15:07:49 +00:00
worker feat(worker): distinguish signal-killed job exits from real crashes in logs 2026-08-29 11:43:52 +00:00
xceadmin test(admin-config-tool): update standby-redirect E2E for bug-1700/1701 2026-08-29 12:10:28 +00:00
flake.lock fix librtti package leak issue 2026-07-27 15:31:50 +08:00
flake.nix feat(dirty-content-fingerprint): Nix flake computes fingerprint via self.narHash 2026-08-21 04:57:56 +00:00
meson.build feat(dirty-content-fingerprint): add dirty_fingerprint meson option and C define 2026-08-21 03:54:37 +00:00
meson.options feat(dirty-content-fingerprint): add dirty_fingerprint meson option and C define 2026-08-21 03:54:37 +00:00