Repository navigation
examples: add changefeed_health collection + integration tests - #294
Merged
Merged
Conversation
Monitors changefeed lag and orphaned protected timestamp records. Co-Authored-By: roachdev-claude <roachdev-claude-bot@cockroachlabs.com>
sravotto
force-pushed
the
sr8/cdc-query
branch
from
September 25, 2026 20:09
7c9724f to
ad2248a
Compare
Runs each examples/*.yaml collection against a real CockroachDB cluster, catching query/schema drift (label or metric counts drifting from a query's actual columns). Also fixes schema-drift bugs the new test caught: - examples/intents.yaml: crdb_internal.ranges_no_leases no longer has a table_id column as of v25.3+, so the table id is now parsed out of start_pretty. The test itself only checks the query runs, since CockroachDB v26.3's write buffering can keep an open write from showing up as a replicated intent. - examples/sqlefficiency.yaml: CockroachDB v26.3 removed crdb_internal.node_statement_statistics.implicit_txn with no replacement (cockroachdb/cockroach#141862), so the "explicitlio" bucket is dropped. - examples/cluster_sqlactivity.yaml: v26.3 added a native database column to crdb_internal.statement_statistics, which collided with the query's metadata->'db' as database alias and broke GROUP BY; renamed the intermediate alias to db_name. Adds testutil.SupportsAllowUnsafeInternals, which checks CRDB_TEST_SERIES against a v25.1 floor so the new test runs on CockroachDB v24.3 instead of failing when allow_unsafe_internals is unrecognized there. Co-Authored-By: roachdev-claude <roachdev-claude-bot@cockroachlabs.com>
sravotto
force-pushed
the
sr8/cdc-query
branch
from
September 25, 2026 20:33
ad2248a to
b3090bb
Compare
sravotto
marked this pull request as ready for review
September 28, 2026 19:04
sravotto
force-pushed
the
sr8/cdc-query
branch
from
October 8, 2026 13:30
825669c to
1dff908
Compare
The examples integration test ran as root, which hid the privileges an operator actually has to grant. Each case now runs as a role holding only what "visus init" provisions (VIEWACTIVITY), plus the extras declared by a new setupPermission hook, and every examples/*.yaml states those extras in a comment at the top. Running restricted surfaced two gaps on CockroachDB v24.3: crdb_internal.tables and cluster_contended_tables omit rows for tables the role can't read, so contended_tables.yaml and index_usage.yaml returned no samples. v25.4 and later don't filter. Also drops the orphaned gauge from changefeed_health.yaml. Its CTE flagged protected timestamp records from any job type, so a paused backup read as an orphaned changefeed, and the reconciler already clears records whose job is missing or terminal. protected_ts.yaml covers protected timestamp age cluster-wide. lag_seconds now converts the high-water mark with hlc_to_timestamp; the old division truncated to whole seconds and could report a negative lag. Raises the SupportsAllowUnsafeInternals floor from v25.1 to v25.4, the series that actually introduced allow_unsafe_internals. Co-Authored-By: roachdev-claude <roachdev-claude-bot@cockroachlabs.com>
sravotto
force-pushed
the
sr8/cdc-query
branch
from
October 8, 2026 13:51
1dff908 to
86e9445
Compare
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.
Monitors changefeed lag and orphaned protected timestamp records.
Add integration test running every examples/ collection.
Also fixes schema-drift bugs the new test caught:
Co-Authored-By: roachdev-claude roachdev-claude-bot@cockroachlabs.com