fix(supply-layers): dev_group_name in L3 upsert key (#970 CRITICAL) #1035
No reviewers
Labels
No labels
admin
analytics
auth
automation
bug
business
chore
ci
compliance
data
data-moat
docs
duplicate
dx
enhancement
Fable 5 ревью
feedback/max
generative
GG-форсайт
needs-discussion
needs-human
observability
pause-bots
performance
priority/p0
priority/p1
priority/p2
priority/p3
scope/backend
scope/db
scope/devops
scope/frontend
scope/qa
scrapers
security
site-finder
stage/1
stage/2
status/blocked
status/done
status/needs-analysis
status/needs-fix
status/qa
status/ready
status/review
status/wip
tech-debt
tradein
ux
week ревью 1
wontfix
вторичка
ИРД
No milestone
No project
No assignees
1 participant
Notifications
Due date
No due date set.
Dependencies
No dependencies set.
Reference: lekss361/gendesign#1035
Loading…
Add table
Reference in a new issue
No description provided.
Delete branch "fix/970-l3-dev-group-key"
Deleting a branch is permanent. Although the deleted branch may continue to exist for a short time before it actually gets removed, it CANNOT be undone in most cases. Continue?
REOPENED CRITICAL #970 — L3 future-supply collapse (~95.6% loss).
L3 computed per (district_name, dev_group_name) but dev_group_name was never a key column -> all dev_groups of a district collapsed into one upsert key. Ground-truth (Akademichesky, prod): should be 13808 units / 15 dev_groups, only 1 row / 607 survived.
Migration 128: +dev_group_name column + rebuild uq_supply_layers_logical -> (layer,district_name,complex_id,obj_class,dev_group_name,source,snapshot_date) NULLS NOT DISTINCT (L1/L2 unaffected, L3 un-collapses). Dry-run vs prod catalog OK.
Worker: dev_group_name in SupplyLayerRow + _UPSERT_SQL INSERT/VALUES/ON CONFLICT (CAST, not in DO UPDATE). No-collapse regression tests. 234 supply tests green.
Deploy applies migration before restart; collapsed data self-heals on next supply_layers_refresh. Verification = prod re-measure post-deploy. Refs #970