-
Notifications
You must be signed in to change notification settings - Fork 3.9k
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
104714: sql: create new system observability tables and update job r=koorosh a=koorosh This commit is the combination of two separate work streams, brought together for resolving logic test fallout simultaneously. The first, authored by `@koorosh` is the creation of system.transaction_exec_insights and system.statement_exec_insights. The second, authored by `@zachlite` in #111365 is the creation of system.mvcc_statistics and the MVCCStatisticsUpdate job. Regarding persisted insights: Before, this data was kept in memory only and tracked limited number of latest insights. These tables will be used to persist this data periodically. Tables allow to store the same information as in memory insights without aggregation. To control the amount of data stored in tables, there will be follow up PR to run GC job and prune old records. To make tables flexible to changes when some columns might become obsolete, most of the columns defined as nullable. Regarding persisted MVCC Statistics: The system.mvcc_statistics table stores historical mvcc data for a tenant's SQL objects. It's purpose it to serve mvcc data for a SQL object quickly - The span stats API is too slow to use in a hot path. Storing data over time unlocks new use cases like showing a table or index's accumulated garbage over time. The MVCCStatisticsUpdate Job is responsible for managing the contents of the table, decoupled from the read-hotpath. Both the table and job are baked when a cluster bootstraps itself, or upgrades itself from a previous version. This PR supersedes #111365 with the following changes: - Descriptor fixes to the mvcc_statistics table. No logical changes, just housekeeping to make sure that the create table schema and descriptors produce the same table. - Fixes to the job to make sure the job system can wind down. Partially resolves: #104582 Epic: [CRDB-25491](https://cockroachlabs.atlassian.net/browse/CRDB-25491) Release note: None 111660: sctest: Add a test that runs comparator testing from logictest stmts r=Xiang-Gu a=Xiang-Gu This commit introduced a new test that takes as input a path to a corpus file (of stmts collected from logic tests) and feed them into the comparator testing framework. It also edit the existing nightly such that we now collect the corpus and immediately feed them into the comparator testing framework, without having to store them in the cloud in between. Fixes #108183 Epic [CRDB-30346](https://cockroachlabs.atlassian.net/browse/CRDB-30346) Release note: None Co-authored-by: Zach Lite <[email protected]> Co-authored-by: Xiang Gu <[email protected]>
- Loading branch information
Showing
124 changed files
with
2,192 additions
and
458 deletions.
There are no files selected for viewing
This file contains 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
32 changes: 32 additions & 0 deletions
32
build/teamcity/cockroach/nightlies/schema_changer_comparator_nightly_impl.sh
This file contains 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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,32 @@ | ||
#!/usr/bin/env bash | ||
|
||
set -xeuo pipefail | ||
|
||
dir="$(dirname $(dirname $(dirname $(dirname "${0}"))))" | ||
source "$dir/teamcity-support.sh" | ||
|
||
CORPUS_DIR=/artifacts/logictest-stmts-corpus-dir # dir to store all collected corpus file(s) | ||
exit_status=0 | ||
|
||
# Collect sql logic tests statements corpus. | ||
bazel run -- //pkg/cmd/generate-logictest-corpus:generate-logictest-corpus \ | ||
-out-dir=$CORPUS_DIR \ | ||
|| exit_status=$? | ||
|
||
bazel build //pkg/cmd/bazci --config=ci | ||
BAZEL_BIN=$(bazel info bazel-bin --config=ci) | ||
|
||
# Run schema changer comparator test with statements from the collected corpus file(s). | ||
for CORPUS_FILE in "$CORPUS_DIR"/* | ||
do | ||
$BAZEL_BIN/pkg/cmd/bazci/bazci_/bazci test -- --config=ci \ | ||
//pkg/sql/schemachanger:schemachanger_test \ | ||
--test_arg=--logictest-stmt-corpus-path="$CORPUS_FILE" \ | ||
--test_filter='^TestComparatorFromLogicTests$' \ | ||
--test_env=GO_TEST_WRAP_TESTV=1 \ | ||
--test_env=GO_TEST_WRAP=1 \ | ||
--test_timeout=7200 \ | ||
|| exit_status=$? | ||
done | ||
|
||
exit $exit_status |
22 changes: 0 additions & 22 deletions
22
build/teamcity/cockroach/nightlies/sqllogic_statements_corpus_nightly_impl.sh
This file was deleted.
Oops, something went wrong.
This file contains 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
This file contains 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
This file contains 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
This file contains 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
This file contains 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
This file contains 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
This file contains 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
This file contains 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
This file contains 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
Oops, something went wrong.