Repository navigation
fix(models): model versions are keyed per dataset, so a second dataset can upload and activate its own default (#1444) - #1447
Merged
Conversation
…t can upload and activate its own default (#1444) matching_models carried two org-scoped uniques: (org_id, name, version) and (org_id, name) WHERE active. Every model statement allocates, activates and reads per dataset, so a second dataset's first upload under the default name hit a unique violation, served as a 500 with the raw constraint text. Found live on er-dev setting up #558. Activating a second dataset's default would have collided the same way. - The indexes are re-scoped to (dataset_id, name, version) and (dataset_id, name) WHERE active. - Fixup 0007_per_dataset_model_keys drops the org-scoped originals on live stores. Safe, like 0006: it only loosens, and no release relied on org-wide uniqueness. - create_model_version maps a unique violation (now only a racing concurrent upload) to 409 instead of a raw 500. pg_model_per_dataset: two datasets each get their own default v1, and activating v2 in one leaves the other's v1 active. The store carries only the per-dataset keys. pg_model_registry's constraint-name assertion follows the rename; it and pg_schema_replay pass. Co-Authored-By: Claude Opus 5.5 <[email protected]>
Contributor
|
The marketing preview was removed because this PR is closed or merged. |
athvin
temporarily deployed
to
marketing-preview
November 29, 2026 15:23 — with
GitHub Actions
Inactive
This was referenced Nov 29, 2026
This branch was previously deployed
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Closes #1444
What
Model versions are keyed per dataset.
matching_models' two uniques are re-scoped to(dataset_id, name, version)and(dataset_id, name) WHERE active.0007_per_dataset_model_keysdrops the org-scoped originals on live stores.Why
A second dataset's first model under the default name returned a 500 with the raw constraint text (found live setting up #558). Activating its
defaultwould have collided with the first dataset's active model. Choice: the fixup isSafe, like 0006, because it only loosens and every model statement was already dataset-scoped.Proof
make checkexit 0. Newpg_model_per_dataset: two datasets each getdefaultv1, and activating v2 in one leaves the other at v1. The store carries only the per-dataset keys.pg_model_registry(constraint-name assertion renamed) andpg_schema_replaypass.Risk & rollback
The boot creates two unique indexes and drops two. Existing rows are unique per org, so they're unique per dataset and the new indexes can't fail to build. Rollback:
git revert <merge-sha>; the dropped org-scoped indexes are not recreated, which only loosens.Post-merge ledger
Closed by: agent · session
Claude Code:24d16c2e-fec6-49d8-9797-060338df4848onbrians-MacBook-Pro· 2026-11-29T16:34:50Zmainis green with this change on it —6273157ce0c092c93713584f0fd281f28f9ef2b9passed Rust, frontend and infra.images— both multi-architecture image builds passed.deploy— production passed. In staginger-server migrate-tenantsreported one active tenant enqueued for catalog5820e10ad626. The post-upgrade hook was still waiting after 20 minutes. Staging cutover and convergence require verification. — run 46278535844: attempts 1 and 2 timed out in the post-upgrade er-tenant-migrate hook behind 10M-scale spill run without eviction #558's running 10M job (the one-writer trap, not this diff). Attempt 3, after the job was cancelled at 16:21Z, succeeded: DEPLOY_SHA 6273157, web-api-green logged 'er-server listening' at 16:32:03Z with p3live holding two datasetsdeploy,drift,kind's nightly leg) is green, or knowingly red for a reason that is notthis change: — infra, devcontainer success on 6273157
Donethrough automation.(a skill, a reference, memory) — or nothing new was learned: — a rollback restores the previous colour's image, so an old image can crash-loop on newer data; that is the rollback, not the new build
Specific to this change
Context — plan, discoveries, measurements, files
Plan
Discoveries
Measurements
Files
🤖 Generated with Claude Code