Conversation
Two structural problems in statements tests: 1. t.Skipf inside a bare for-loop caused the entire timing/report/wal suite to be skipped when the first PG version (9.5) was unavailable. Timing and report query integration tests never ran against PG 17/18. 2. TestSelectStatStatementsTimingQuery and TestSelectQueryReportQuery only asserted version routing up to PG 13, so a regression in the PG 17+ routing would go undetected. Fixes: - Split timing and WAL loops into per-version t.Run sub-tests; missing instances now skip only that version, not the entire suite. - Extend WAL stats test to cover PG 13-18 (was hardcoded to PG 13). - Add PG 14/16/17/18 cases to both unit routing tests, asserting that PG 17+ returns the blk_read_time-free PG17 query variants. Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
…version Convention: PGxx suffix marks a query valid from PG xx (now superseded); Default marks the query for the current/latest supported version. Previously violated by two files: - wal.go: PgStatWALDefault covered PG 14-17 (not latest); PgStatWALPG18 covered PG 18+ (latest). - statements.go: PgStatStatementsTimingDefault / ReportQueryDefault covered PG 13-16; PG17 variants covered PG 17+ (latest). Renames: - PgStatWALDefault → PgStatWALPG14 - PgStatWALPG18 → PgStatWALDefault - PgStatStatementsTimingDefault → PgStatStatementsTimingPG13 - PgStatStatementsTimingPG17 → PgStatStatementsTimingDefault - PgStatStatementsReportQueryDefault → PgStatStatementsReportQueryPG13 - PgStatStatementsReportQueryPG17 → PgStatStatementsReportQueryDefault Updated: selector functions, view.go initial templates, all test references. Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
…ssue #122) Commit cbfa0a4 added shared_preload_libraries to SelectCommonProperties, increasing the metadata column count from 7 to 8. readMeta's strict "Ncols != 7" check rejected all tar files recorded after that commit, printing "invalid result" for every report row. Fix: replace "!= 7" with "< 2" — readMeta only reads column 1 (version_num), so the minimum required is 2 columns. This accepts both old (7-col) and current (8-col) metadata without breaking forward compatibility for any future column additions. Adds a regression test with 8-column metadata that previously failed. Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
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
pgcenter reportprintedinvalid resultfor every row when reading any tar file recorded with pgcenter >= 0.9.xrecordand the count expected duringreportRoot cause
Commit
cbfa0a4(July 2021) addedshared_preload_librariestoSelectCommonProperties, increasing the metadata query from 7 to 8 columns. ThereadMetafunction inreport/report.gowas not updated and continued to checkres.Ncols != 7, rejecting all metadata with 8 columns with the errorinvalid result.Because
readMetafails on every metadata entry, thereadTarloop never delivers any data to the processing goroutine — hence every report row showsinvalid result.Fix
Changed
res.Ncols != 7→res.Ncols < 2inreadMeta.readMetaonly readsres.Values[0][1](theversion_numfield at index 1), so the actual minimum requirement is 2 columns. The loose check makes the function robust to both old (7-col) and current (8-col) metadata, and any future column additions.Test plan
Test_readMeta: 8-column metadata (withshared_preload_libraries) — was failing before, passes after{Ncols: 1, Nrows: 1}still fails (insufficient columns guard)go test ./...passesCloses #122
🤖 Generated with Claude Code