Repository navigation
perf: reuse demo publication artifacts - #449
Merged
Merged
Conversation
| LegacyTokenLookupMaintenance, | ||
| ) | ||
|
|
||
| revision: str = "3c4d5e6f7a8b" |
| ) | ||
|
|
||
| revision: str = "3c4d5e6f7a8b" | ||
| down_revision: str | None = "2b3c4d5e6f7a" |
|
|
||
| revision: str = "3c4d5e6f7a8b" | ||
| down_revision: str | None = "2b3c4d5e6f7a" | ||
| branch_labels: Sequence[str] | None = None |
| revision: str = "3c4d5e6f7a8b" | ||
| down_revision: str | None = "2b3c4d5e6f7a" | ||
| branch_labels: Sequence[str] | None = None | ||
| depends_on: Sequence[str] | None = None |
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.
Summary
We complete the next local performance changes after #448 without changing production settings or indexes:
--uploadoperation.idx_document_map_unit_tokens_lookup. The new migration retains it by default; replayable operator commands apply or restore it at the same Alembic head.Observed effects
The cache has a first-fill cost and a per-process warm-up requirement. These are focused local observations, not production latency guarantees. The large-clone index experiment predates canonical bundle reuse; its total HTTP time remained about 54 seconds. We do not combine separate experiments into a claimed production result or claim full SpaceX parsing below ten seconds.
Verification
reusedand retained the object count at 6383.git diff --checkpassed. No broad repeated benchmark campaign was run.Commands for the newly added focused contracts:
Deployment Notes / DevOps
Controls and rollout order
DEMO_CANONICAL_BUNDLE_ENABLEDfalseDEMO_PUBLICATION_PREPARATION_CACHE_ENABLEDfalseDeploy the compatible writer and artifact readers. Ordinary deployment records migration
3c4d5e6f7a8bwithout deleting the lookup index. Queue contracts and the existing publication strategy are unchanged.With the deployed source files and the API's protected storage/Redis environment, inspect and then prepare the bundle:
Preparation creates no jobs, documents, credits or retrieval state. A completed content version is reused. New, unprepared source versions still need an initial upload.
Enable
DEMO_CANONICAL_BUNDLE_ENABLED=trueon API instances and verify materialization plus actual artifact downloads. Optionally enable the separate preparation cache; each API process fills its own cache.Treat index retirement as a separate, explicitly approved database operation. Supply
DATABASE_URLand applicableDB_SSL_*settings through the protected environment, then inspect/apply:The operator validates replacement definitions and validity/readiness, uses concurrent DDL and reads the catalog back. Keep the binary lookup, unit lookup, unit index and primary key. Observe real publication/retrieval and token-stage I/O before accepting the rollout.
Rollback and artifact lifecycle
Set
DEMO_PUBLICATION_PREPARATION_CACHE_ENABLED=falseand restart API processes to disable preparation reuse and clear process memory. Persisted retrieval data is unchanged.Set
DEMO_CANONICAL_BUNDLE_ENABLED=falseto restore per-job uploads for new materializations. Keep prefix-aware readers deployed for existing canonical results. A binary rollback to older readers requires per-job artifact restoration first.Preserve shared canonical objects for their full reference lifetime. Per-document archive must not delete them; storage lifecycle rules must preserve the canonical prefix. Reuse checks the marker and ZIP size, not every raw object. If a raw object is deleted after completion, invalidate that exact version's ready marker and rerun preparation against the same source version.
Restore the legacy index without downgrading schema history:
Restoration scans the token table and requires time, disk and I/O; application rollback alone does not recreate it. Coordinate one index operation at a time and inspect interrupted concurrent DDL before retrying.
Detailed evidence and procedures:
docs/design/canonical-demo-bundle-reuse.mddocs/design/canonical-demo-preparation.mddocs/design/demo-publication-preparation-cache.mddocs/design/legacy-token-lookup-retirement.mddocs/design/publication-scale-cold-cache-findings.mdChecklist