fix(search): preserve full-document trigram storage - #1572
Draft
seonghobae wants to merge 1 commit into
Draft
seonghobae wants to merge 1 commit into
seonghobae wants to merge 1 commit into
Conversation
Replace four overflowing GiST leaf representations with full-content GIN in a forward migration; leave revision 0010 unchanged. Preserve exact ranking SQL and rollback data, and keep the proposal Draft until representative search and migration costs are verified. Real migrated PostgreSQL: four regression failures before repair; 131 passing tests after repair. Record the owner boundary, rejected options, diagnostic receipts, and ADR-0020 numbering inventory. Co-authored-by: Codex <noreply@openai.com> Signed-off-by: Seongho Bae <me@seonghobae.me>
Contributor
|
Important Draft PR not reviewedDraft PRs are not automatically reviewed by default.
To automatically review draft PRs, update your CodeRabbit configuration: reviews:
auto_review:
drafts: trueThanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out. Comment |
seonghobae
added a commit
that referenced
this pull request
Sep 5, 2026
Refresh baseline 1.25 with pushed owner propagation, Draft search repair #1572, and current AGENTS #1566 evidence. Keep the uncommitted provenance integration and its remaining large-content failure separate from remote-head passes. Retain representative search and migration costs as open acceptance gates; no protected or released behavior is claimed. Co-authored-by: Codex <noreply@openai.com> Signed-off-by: Seongho Bae <me@seonghobae.me>
seonghobae
added a commit
that referenced
this pull request
Sep 5, 2026
Preserve the unique no-unconditional-legacy-index assertion and both owner histories. Correct the historical-only canonical-index release claim; conditional legacy handling remains inherited from #1503. Exact dependency sync, fresh and repeat migration 0020, and 131 strict PostgreSQL tests pass. Search and migration performance remain Draft acceptance gates in #1572; no protected completion is claimed. Co-authored-by: Codex <noreply@openai.com> Signed-off-by: Seongho Bae <me@seonghobae.me>
This was referenced Sep 5, 2026
seonghobae
added a commit
that referenced
this pull request
Sep 5, 2026
…ties Preserve both parent deltas and reconcile bootstrap against the canonical owner implementation. Real migration and rollback tests pass; forced import overlap preserves the winner and rejects incompatible changes. Local integration checkpoint: 288 tests pass, but the unchanged large-content case still fails at the GiST index limit. Do not publish as passing integration until search-schema owner #1572 is inherited and the original case passes. Co-authored-by: Codex <noreply@openai.com> Signed-off-by: Seongho Bae <me@seonghobae.me>
This was referenced Sep 5, 2026
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.
Descendant integration update (2026-09-05)
The search owner head remains
cd8ff413d4ed8a5f2855c47a21a31db5661cd487. Its prerequisite has now propagated by ordinary merges through #146853ce38ed6683d01a9d113069f5ac5a8f17e133a2(131 strict tests), #1427cb08b1c3ea2aba8844fc29ef703c34368cc55e47(132), and #149769f50ae684f50c501ff2f49be2969f1d211d7f3c(345, zero failed/skipped). The previously unchanged 8 MiB-class archive regression now passes on the combined actual migration graph, alongside retained-identity rollback and forced incompatible-writer cases. Each lane has its own exact source/tree receipt; descendant passes do not substitute for this owner's required Checks or approval.A separate read-only Agent review of this exact owner head found no blocking source/rollback/documentation findings and ran no tests or GitHub approvals. GIN distance-order acceleration is still absent; representative search p95 and migration lock/build/storage costs, hosted Checks, independent approval, and release gates remain open. Keep Draft. The original receipt below describes the owner experiment and the earlier descendant failure as historical evidence.
Customer failure and scope
A valid long email, attachment, cited segment, or project document can fail to persist before restore/export/search starts. Real migrated PostgreSQL exposed this in the unchanged large-segment regression during the pending #1497 integration; ORM-only tables had hidden the migration-created index limit.
This Draft is the Naruon-owned search-schema prerequisite on #1503. Existing #1468 → #1427 → #1497 deltas stay open and will inherit it through non-force merges. No existing open PR owned the whole-document trigram repair after checking the current PR file inventory. No predecessor is closed or marked fully succeeded by this PR.
Exact source and decision
19d5860bc27e860acba940390f5792721cd99e5e(fix/workspace-document-registry-migration).cd8ff413d4ed8a5f2855c47a21a31db5661cd487.526b7c334a00020e5f3ac49d76d3fdd2b44a9665.0020_search_trigram_storagereplaces the four complete normalized GiST expressions with GIN using structured Alembic operations. Published revision 0010 is unchanged; no document is shortened, hashed, omitted, copied, or rewritten.Performance remains an explicit acceptance gate: GIN does not accelerate the existing distance-only top-k ordering. This is a storage-correctness candidate, not equivalent-performance evidence or approval to ship slower search. Representative permitted data, query plans, end-to-end p95 ≤20 ms, simultaneous writers, and migration costs remain unverified. Do not add an arbitrary similarity threshold or shrink the measurement population to manufacture a pass.
RED → repair → GREEN
siglen=256and2024both fail with SQLSTATE54000(12,304-byte index row, 8,191-byte maximum); GIN retains the identical full value.-W error, 28.03 seconds, after exactuv sync --lockedand fresh/repeated upgrade to0020_search_trigram_storage.Exact commands, image digest, scope limitations, cleanup, and local artifact hashes are in
docs/doctoring/search_trigram_storage.md. Local evidence is not hosted Actions, signed-browser restore, protected merge, release, or deployment evidence. Test-only generated records are not production performance data. Existing customer resources and the main user checkout were untouched.Decision traceability and follow-up
ADR-0020 is Proposed and records the customer failure, constraints, alternatives, rejection reasons, risks, and verification. All 160 open PR file lists were checked, including the second #1287 file page: 0008 is already used by #1418 and 0019 by #1419, so the never-committed local 0008 draft was renumbered. Historical ADR collisions elsewhere remain repair findings.
Primary references (APA 7th)
PostgreSQL Global Development Group. (n.d.). pg_trgm—Support for similarity of text using trigram matching (PostgreSQL 16). Retrieved September 5, 2026, from https://www.postgresql.org/docs/16/pgtrgm.html
PostgreSQL Global Development Group. (n.d.). trgm_gist.c [Source code, commit ad6ffe6a1ffddf19603b13633f054f3d66ef4277]. https://github.com/postgres/postgres/blob/ad6ffe6a1ffddf19603b13633f054f3d66ef4277/contrib/pg_trgm/trgm_gist.c#L107-L143