lablup / lablup/backend.ai

Remove redundant scaling-group rewrite at allocation time

Open Beginner friendly
#12,549 0 comments 0 reactions 0 assignees View on GitHub
Dominant language
Python
Stars
670
Forks
183
Avg merge
15h 13m
Merged PRs (30d)
368

Description

Goal

Remove the redundant scaling-group writes performed at allocation time in the scheduler repository. Sessions and kernels already receive their scaling group (name and resource_group_id) as non-null values at enqueue (BA-6644 / BA-6648), and the allocation-time value is a pure round-trip of the session's own value (PendingSessionData -> SessionWorkload -> SessionAllocation -> UPDATE back onto the same row). target_sgroup_names re-routing is never read by the scheduler, so the rewrite is dead work and a future id/name divergence risk once readers move to resource_group_id.

Scope

- repositories/scheduler/db_source/db_source.py: remove scaling_group_name= from the session resource-assignment UPDATE (~line 2110); keep agent_ids update.
- Same file: remove scaling_group= from the kernel SCHEDULED-promotion UPDATE (~line 2096).
- Optional (same file, one line): switch the enqueue access check (~line 1563) to compare AllowedScalingGroup.id against draft.scope.resource_group_id instead of names.

Success Criteria

- [ ] Allocation update no longer writes scaling_group_name / kernel scaling_group; agent assignment fields are still written
- [ ] Session/kernel scaling group values after scheduling are identical to enqueue-time values (existing scheduler tests pass unchanged)
- [ ] pants test passes for affected packages

JIRA Issue: BA-6706

Contributor guide

Open the contributing guide

Research direction

Start in repositories/scheduler/db_source/db_source.py around the allocation updates near lines 2096 and 2110, then review the enqueue access check near line 1563. Remove the redundant scaling-group writes while preserving agent assignment updates; verify scaling-group values remain unchanged from enqueue time and run pants test for the affected packages.

Written by the indexing model from the issue text.

Assessment

Tech stack
python
Domain
backend, distributed-systems
Issue type
Refactor
Difficulty
2/5
Estimated time
1-3 hours
Activity status
Quiet
Clarity
Clearly specified
Newbie friendliness
84/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.