-
Notifications
You must be signed in to change notification settings - Fork 1
perf(web): release provider work and bound landing reads #629
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Changes from all commits
0545560
45b0a44
24d8fa1
3d69ea4
8797605
2e4fbc5
fee4d76
99f6b81
23e3fde
09ce91b
445571a
ca5d304
08e8705
71c10dd
4967528
ccb4bb9
143a6a3
238a6cd
883d1ff
ac38c65
0f4665b
74823e9
4b4d670
6d2fb7b
0138db5
c95f931
967ba24
48496ff
134e8f0
b2bc72c
c00b571
b721b0f
fcb933b
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
| Original file line number | Diff line number | Diff line change |
|---|---|---|
|
|
@@ -7,6 +7,53 @@ | |
| -- Mirrors the durable-row-plus-stream design post_content_job already | ||
| -- uses, so a lost stream entry is recovered from the queued rows. | ||
|
|
||
| -- Existing volumes must not silently retain a differently-shaped queue table. | ||
| -- `IF NOT EXISTS` is idempotent only when the existing object is compatible; | ||
| -- fail before any insert path can observe a partial schema. | ||
| do $$ | ||
| declare | ||
| account_index regclass; | ||
| queued_index regclass; | ||
| begin | ||
| account_index := to_regclass('public.global_ask_job_account_idx'); | ||
| queued_index := to_regclass('public.global_ask_job_queued_idx'); | ||
| if to_regclass('public.global_ask_job') is not null | ||
| and exists ( | ||
| select 1 | ||
| from (values | ||
| ('global_ask_job_id', 'uuid'), | ||
| ('requesting_account_id', 'uuid'), | ||
| ('question_text', 'text'), | ||
| ('job_status_code', 'text'), | ||
| ('answer_payload', 'jsonb'), | ||
| ('failure_detail', 'text'), | ||
| ('created_at', 'timestamp with time zone'), | ||
| ('updated_at', 'timestamp with time zone') | ||
| ) as required(column_name, data_type) | ||
| where not exists ( | ||
| select 1 | ||
| from information_schema.columns column_info | ||
| where column_info.table_schema = 'public' | ||
| and column_info.table_name = 'global_ask_job' | ||
| and column_info.column_name = required.column_name | ||
| and column_info.data_type = required.data_type | ||
| ) | ||
| ) then | ||
| raise exception 'global_ask_job exists with an incompatible schema'; | ||
| end if; | ||
| if account_index is not null | ||
| and pg_get_indexdef(account_index) | ||
| not ilike '%(requesting_account_id, created_at DESC)%' then | ||
| raise exception 'global_ask_job_account_idx exists with an incompatible definition'; | ||
| end if; | ||
| if queued_index is not null | ||
| and pg_get_indexdef(queued_index) | ||
| not ilike '%(created_at)%where%job_status_code%' then | ||
| raise exception 'global_ask_job_queued_idx exists with an incompatible definition'; | ||
|
Comment on lines
+23
to
+52
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. 🗄️ Data Integrity & Integration | 🟠 Major | ⚡ Quick win 기존 객체의 전체 실행 계약을 검증하세요. Lines 23-40은 컬럼 이름과 데이터 타입만 검사합니다. 예를 들어
🤖 Prompt for AI Agents |
||
| end if; | ||
| end | ||
| $$; | ||
|
seonghobae marked this conversation as resolved.
|
||
|
|
||
| create table if not exists global_ask_job ( | ||
|
seonghobae marked this conversation as resolved.
|
||
| global_ask_job_id uuid primary key default uuid_generate_v4(), | ||
| requesting_account_id uuid not null references user_account (user_account_id), | ||
|
|
||
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
📝 Info: Evidence guard can silently drop a valid external result
The UPDATE's new guard
($5::uuid is null or exists (...source_post...))protects against the internal evidence post being deleted between search and write (it has an FK). In that race the whole row fails to update, so the external verification status is not persisted and the row staysverify_pending, even though _find_internal_evidence_post documents that internal evidence 'never changes the external verification status'. Narrow race; the row is recoverable on a later re-verify.Was this helpful? React with 👍 or 👎 to provide feedback.