knowledge: PostgreSQL catalog statistics + a branch masked by another writer (2 ingested, 1 folded into #73, 1 dropped as dup of #52) - #78
Open
dch0202-rsquare wants to merge 4 commits into
Conversation
…as evidence about current table contents
…1 dropped as dup of choiyounggi#52
…f the same observable
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.
Knowledge flush — 4 insight(s): 2 ingested, 1 folded into #73, 1 dropped as an in-flight duplicate
Verified best-practice
1. PostgreSQL catalog statistics are not evidence about a table's current contents — verified (ingested)
Claim. To find the newest rows of a large unindexed table, start the
ctidtailscan at
pg_relation_size(rel)/current_setting('block_size')::int, not atpg_class.relpages; bound the range probe by aggregating (DISTINCT/max/count)rather than with
LIMIT n; and readlast_analyze/n_mod_since_analyzebeforeciting
pg_statsmost-common values as the value set.Every URL below was opened in this session and the quoted text read out of the
fetched page (they are reproduced verbatim in the page's Sources block):
relpagesis a stale snapshotVACUUM,ANALYZE, and a few DDL commands such asCREATE INDEX";reltuplesis-1when never vacuumed/analyzedpg_relation_sizemeasures actual bytesblock_size"is determined by the value ofBLCKSZwhen building the server. The default value is 8192 bytes"pg_statsis a sample from the last analyzeANALYZEtakes a random sample of the table contents"; "the statistics are only approximate"last_analyze,last_autoanalyze,n_mod_since_analyze,n_live_tupdefinitionsctidwill change if it is updated or moved byVACUUM FULL"TIDs… Previously a sequential scan was required for non-equalityTIDspecifications"Field observation carried from the session (PRD,
external_data.collected_from_seumter,read-only):
relpages43992 vspg_relation_size44897 blocks;ctid > '(43970,0)' LIMIT 20returned only20260619whileDISTINCToverctid > '(44880,0)'returned
20260719; thepg_statsMCV list topped out at20260427;reltuples1,069,782 vsn_live_tup1,092,465.Corrections made to the raw candidate during verification (the candidate is a
draft, not the page): the candidate hard-coded
/8192, which theblock_sizepreset contradicts → the page divides by
current_setting('block_size'). Thecandidate also stated the tail-scan technique unconditionally; the
ctiddoc'supdate/
VACUUM FULLcaveat and the PG14 release note bound it to append-mostlytables on PG 14+, both now edge-case rows. No local Postgres was available in this
environment (no
psql, docker daemon down), so the mechanism rests on the officialdocs plus the field observation — no reproduction was fabricated.
2. A mechanism fixture equal to the shipped default — verified (folded into #73)
Claim. When a config knob's test fixture repeats the code's default value,
"override honoured" and "override ignored" produce the same output, so
cfg.get("k", DEFAULT) → DEFAULTis unkillable by any assertion.Mechanism is deductive (two paths with an identical observable) and was reproduced
in the field. Evidence opened and re-read in this session rather than taken from the
candidate's prose:
heal/heal_detector.py:30RENOTIFY_SEC_DEFAULT = 21600and:225renotify = det.get("renotify_sec", RENOTIFY_SEC_DEFAULT); the tests nowcarry
{"renotify_sec": 100}(heal/test_heal_detector.py:420,435), the post-fixstate the candidate describes. Reported result: at fixture
21600theknob-deleting mutant left 36 tests GREEN; at fixture
100, no assertion changed,the same mutant went RED in 2 cases. The existing citation base of the target page
(PIT "Survived", Stryker mutator set) already covers the mutation vocabulary used.
3. Python bytecode cache invalidates a mutation run — verified but already carried (dropped)
The claim (equal-size same-second edits reuse cached bytecode; purge
__pycache__and run under
-B; require a surviving no-op control) is correct and sourced — andopen PR #52 already carries it in
backend/python/language/bytecode-cache-staleness, including the exact nuance thecandidate adds: "Both settings govern writing only … so a
.pycleft on disk by anearlier run is still validated and reused … Purge
__pycache__once before the runand keep
-Bset for the rest of it", cited to docs.python.org/3/using/cmdline.html.Nothing in the candidate is absent there.
4. A branch whose bookkeeping another writer on the same path repeats — verified (ingested)
Claim. When the branch you are pinning writes a flag or counter that a later
loop, retry, or error handler on the same execution path also writes, assert it from
an input that leaves those other writers inert (empty collection, no error injected).
With both active, the observable is identical whether or not the branch ran, so
deleting the branch keeps the suite green while coverage and assertion counts rise.
Mechanism is deductive (two writers, one observable) and reproduced in the field.
Evidence re-read from the source this session rather than from the queue row:
heal/heal_detector.py:306-308— thesecret_source == "none"arm setsrun_ok = False; send_failed = Truebefore the message loop, and the loop's ownfailure handling sets the same two. Reported result: deleting the branch left all 42
tests passing, because both
nonecases supplied trigger messages that fail insidethe loop; adding one
messages=[]case (heal/test_heal_detector.py:539,549) turnedthe same deletion RED in 1 test with no assertion changed. The target page's existing
citation base (PIT kill attribution, Google's mutation-testing post, Fowler on
coverage) already carries the vocabulary; no new external source was needed, and none
was invented.
Existing-layer check
Routed via
INDEX.md→ databases ("surveying live data to derive a rule") andtesting ("cases/assertions, test data").
Pages read: databases-data-survey-surveying-live-data-for-a-rule,
databases-query-optimization-reading-execution-plans,
databases-operations-autovacuum-and-wraparound,
databases-query-optimization-existence-and-count-checks,
databases-query-optimization-keyset-pagination,
testing-quality-harness-reverse-controls,
backend-python-language-bytecode-cache-staleness,
testing-data-test-data-and-isolation,
testing-quality-tests-that-cannot-fail
Findings:
surveying-live-data-for-a-rulealso deals withdrawing conclusions from a survey, but its trigger is empty-result ambiguity
when deriving a mapping/enum rule (
GROUP BYover zero rows). The new page'strigger is stale catalog estimates standing in for heap contents. Different
question, different remedy; cross-linked both ways (the existing page's
related:now names the new one).
grepfordegenerate|equal to the default|same as the defaultacross the merged wiki returned nothing; there is no page on catalogstatistics as an evidence source.
directive on the pages read;
reading-execution-plansis referenced inline forthe "probe runs against production" edge case.
surveying-live-data-for-a-rulefrontmatterrelated:only(no body change).
tests-that-cannot-failalready owns the"prove a test can fail" trigger and its mutation-outcome table already splits
"exactly the expected test reddens" / "the file reddens, the target test does not"
/ "no test reddens". Insight 4 is the fourth outcome in that same table — an
assertion on the observable exists and still nothing reddens — so it became one
table row, one edge case, one Instead-of row and one Sources entry on that page
rather than a new page.
surviving-mutant-equivalence-triage(open PR knowledge: 4 verified insights — surviving-mutant triage, source-text wiring assertions, query state vs fetch state, python text-io encoding #52) wasread and considered as the alternative home; its step-1 table classifies a survivor
as uncovered / weak-test / equivalent, and this case is a fourth class, but placing
it there would put the row on an unmerged branch and split one table across two
pages. The two pages are already cross-linked.
bytecode-cache-staleness) was read in both its mergedand its knowledge: 4 verified insights — surviving-mutant triage, source-text wiring assertions, query state vs fetch state, python text-io encoding #52 form — the merged form alone would have justified an append, and the
knowledge: 4 verified insights — surviving-mutant triage, source-text wiring assertions, query state vs fetch state, python text-io encoding #52 form makes even that redundant. That distinction is why the open-PR check
below, not the merged-layer check, decided this candidate.
Open-PR check
Listed all 19 open
knowledge/*heads (gh pr list --search "head:knowledge/") andtook each PR's changed-file list, then fetched and read the heads whose files
overlapped a candidate's trigger space. Note: heads #72–#76 live on the fork
dch0202-rsquare/dev-loop, sogit fetch origin <head>fails on them withcouldn't find remote ref— they were fetched from theforkremote instead.…20260807-100149backend/python/language/bytecode-cache-staleness,testing/quality/surviving-mutant-equivalence-triage,harness-reverse-controls-B-governs-writing-only row…co-kr-20260810-163633testing/quality/default-values-under-test(new page),tests-that-cannot-fail,minimum-case-set74215dcto that branch and noted on the PR…20260807-213244testing/data/harness-vs-run-path-fixtures,harness-reverse-controls,test-data-and-isolationtests-that-cannot-fail,harness-reverse-controlscomparing-two-execution-plans), #73 (trigram-index-short-patterns,index-selection)ctidscanning — candidate 3's target area is untouched by every open headThe late-arriving insight 4 was diffed against the same set: the only heads touching
tests-that-cannot-failare #52, #49, #47 and #73, and none of them adds amasked-observable case. Checked by retrieving each head's own version of that file
and searching it for the concept (
inert|also writes|same observable|only this branch): 0 hits on all four, with the file present on each (121/121/124/125 lines,so the empty result is an absence of the content, not a failed retrieval). Verdict
new.
Per-candidate verdicts: 2 new (catalog statistics; masked branch bookkeeping),
1 fold (#73), 1 drop (pending duplicate of #52). No sibling duplicate PR was
opened for either the folded or the dropped candidate.
Routing decision
databases/data-survey/catalog-statistics-as-current-state.md(new page, existing category)data-surveyowns.operationswas considered and rejected: that category is about running VACUUM/ANALYZE (bloat, wraparound tuning), while this page is about reading their leftovers as evidence.query-optimizationwas rejected because thectidscan here is a probe, not a query being made faster. No new category neededtesting/quality/default-values-under-test.md— on PR #73's branch, not heretesting/quality/tests-that-cannot-fail.md(merged into the existing page)Plumbing updated on this branch:
wiki/databases/index.md(newdata-surveyrowwith its load-when line),
log.md(dated ingest entry recording all four verdicts),surveying-live-data-for-a-rulerelated:back-link. Page body is 93 lines(limit 120); all four
related:ids and the one inline[page-id]reference wereresolved against
wiki/before commit.Cross-Check: the six load-bearing claims of this report were re-verified against
their artifacts rather than from memory — (a) each cited PostgreSQL URL was fetched
in-session and the page's quoted strings match the fetched text; (b)
relpagesvspg_relation_sizesemantics come from the catalog doc, not from the candidate'sprose, which was corrected on two points (
/8192, unbounded applicability);(c) the #52 duplicate verdict was taken from the branch diff, not from its PR title;
(d) the #73 fold evidence was read out of
heal_detector.py:30,225andtest_heal_detector.py:420,435in the worktree, not copied from the queue row;(e) every
Pages read:id was resolved to a file withgrep -rl "^id: …";(f) the "no open head carries insight 4" claim was run, not assumed — each head's own
copy of the file was retrieved and searched, and each retrieval was confirmed
non-empty first. Not
verified: no reproduction of the catalog staleness was run locally — no
psqlandno running Docker daemon in this environment — so that mechanism rests on the
official docs plus the recorded field observation, and the page says so.
Decision Log
의도
databases/data-survey에 둔 이유: "살아있는 테이블을 조사해 사실을 확정한다"가 그 카테고리의 소유 영역이고, 기존surveying-live-data-for-a-rule(빈 결과 해석)과는 트리거가 다르다. 양방향related링크로 연결했다./8192하드코딩 →current_setting('block_size')(BLCKSZ는 빌드타임), 그리고 무조건 적용 → append-mostly + PG14+ 전제를 edge case로 명시.배제한 대안
-B는 쓰기만 막고 기존.pyc는 계속 읽힌다는 핵심 뉘앙스까지 이미 담고 있어 새로 추가할 델타가 0이었다(브랜치 diff로 확인, PR 제목이 아니라).default-values-under-test)가 PR #73에 인플라이트라 트리거가 인접한 페이지가 두 개 생긴다. knowledge: captured-call argument completeness, pg_trgm short-pattern degeneration, raw JDBC inside a JPA transaction #73 브랜치에 커밋74215dc로 폴드하고 PR에 코멘트를 남겼다.databases/operations에 두는 안 → 배제. 그 카테고리는 VACUUM/ANALYZE를 운영하는 쪽이고, 이 페이지는 그 산물을 증거로 읽는 쪽이다.리뷰어가 볼 곳
wiki/databases/data-survey/catalog-statistics-as-current-state.md— 인용문이 실제 PostgreSQL 문서 문장과 일치하는지(8개 URL 전부 이 세션에서 fetch), 그리고ctid꼬리 스캔의 전제(append-mostly, PG14+)가 edge case로 충분히 좁혀졌는지.psql이 없고 Docker 데몬이 죽어 있어 문서 검증 + 현장 관측(PRD read-only)으로만 뒷받침했고, 페이지와 리포트 양쪽에 그렇게 적었다. [추정] 아님, 미실행 사실 그대로.wiki/databases/index.md의 load-when 줄이 페이지의 "When this applies"와 어긋나지 않는지(drift 방지).