-
Notifications
You must be signed in to change notification settings - Fork 3.8k
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
workload/tpcc: implement remaining consistency checks #99542
workload/tpcc: implement remaining consistency checks #99542
Conversation
eccec74
to
fac3fac
Compare
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.
Nice! Query plans looked good to me.
Reviewed 1 of 1 files at r1, all commit messages.
Reviewable status: complete! 1 of 0 LGTMs obtained (waiting on @herkolategan, @nvanbenschoten, and @smg260)
pkg/workload/tpcc/checks.go
line 363 at r1 (raw file):
return checkNoRows(db, asOfSystemTime, ` SELECT count(*) FROM (SELECT c_id,
nit: trailing whitespace
pkg/workload/tpcc/checks.go
line 365 at r1 (raw file):
(SELECT c_id, c_d_id, c_w_id,
nit: trailing whitespace
This commit adds consistency check 3.3.2.10, 3.3.2.11, and 3.3.2.12 from the TPC-C spec. We'll be using these consistency checks as part of the testing coverage for upcoming changes to transaction isolation. Epic: None Release notes: None
fac3fac
to
58e4295
Compare
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.
TFTR!
bors r=michae2
Reviewable status: complete! 0 of 0 LGTMs obtained (and 1 stale) (waiting on @herkolategan, @michae2, and @smg260)
pkg/workload/tpcc/checks.go
line 363 at r1 (raw file):
Previously, michae2 (Michael Erickson) wrote…
nit: trailing whitespace
Done.
pkg/workload/tpcc/checks.go
line 365 at r1 (raw file):
Previously, michae2 (Michael Erickson) wrote…
nit: trailing whitespace
Done.
Build succeeded: |
I'm finding that the query is correct, but the condition that it's trying to verify does not and should not hold after running the test. Oddly, the spec doesn't mention this explicitly, beyond saying:
However, I took a look at what other implementations of TPC-C do with this check and, sure enough, they hit the same issue. For instance, in pingcap/go-tpc#1, they found:
Long term, we'll want to separate out post-loading checks from post-workload checks. For now, I'll remove the check. |
Fixes cockroachdb#99619. Fixes cockroachdb#99594. Fixes cockroachdb#99603. Fixes cockroachdb#99604. This commit disables TPC-C's consistency check 3.3.2.11 after the workload has run. The check asserts a relationship between the number of rows in the "order" table and rows in the "new_order" table. Rows are inserted into these tables transactional by the NewOrder transaction. However, only rows in the "new_order" table are deleted by the Delivery transaction. Consequently, the consistency condition will fail after the first Delivery transaction is run by the workload. See cockroachdb#99542 (comment) for more details. Release note: None
99509: bazci: protect against `nil` target r=healthy-pod a=rickystewart Closes #98861. Epic: none Release note: None 99532: sql: inject stats into TestExecBuild_sql_statistics_persisted testdata r=ericharmeling a=ericharmeling Background thread: #99240 (comment) Part of #99399. This commit replaces the `CREATE STATISTICS` statements in the `TestExecBuild_sql_statistics_persisted` testdata with `ALTER TABLE ... INJECT STATISTICS` and removes the retry directives added to deflake the test in #99447. Epic: none Release note: None 99642: serverccl: skip TestServerControllerHTTP under deadlock r=dhartunian a=knz Fixes #98046. Release note: None 99660: workload/tpcc: disable check 3.3.2.11 after workload r=renatolabs a=nvanbenschoten Fixes #99619. Fixes #99594. Fixes #99603. Fixes #99604. Fixes #99617. Fixes #99616. Fixes #99613. Fixes #99611. Fixes #99604. Fixes #99603. Fixes #99600. Fixes #99599. Fixes #99598. Fixes #99596. Fixes #99595. Fixes #99594. This commit disables TPC-C's consistency check 3.3.2.11 (added in #99542) after the workload has run. The check asserts a relationship between the number of rows in the "order" table and rows in the "new_order" table. Rows are inserted into these tables transactional by the NewOrder transaction. However, only rows in the "new_order" table are deleted by the Delivery transaction. Consequently, the consistency condition will fail after the first Delivery transaction is run by the workload. See #99542 (comment) for more details. Release note: None Co-authored-by: Ricky Stewart <[email protected]> Co-authored-by: Eric Harmeling <[email protected]> Co-authored-by: Raphael 'kena' Poss <[email protected]> Co-authored-by: Nathan VanBenschoten <[email protected]>
Fixes cockroachdb#99619. Fixes cockroachdb#99594. Fixes cockroachdb#99603. Fixes cockroachdb#99604. This commit disables TPC-C's consistency check 3.3.2.11 after the workload has run. The check asserts a relationship between the number of rows in the "order" table and rows in the "new_order" table. Rows are inserted into these tables transactional by the NewOrder transaction. However, only rows in the "new_order" table are deleted by the Delivery transaction. Consequently, the consistency condition will fail after the first Delivery transaction is run by the workload. See cockroachdb#99542 (comment) for more details. Release note: None
This commit adds consistency check 3.3.2.10, 3.3.2.11, and 3.3.2.12 from the TPC-C spec. Incredibly, these have not been touched since cockroachdb/loadgen#85 and cockroachdb/loadgen#165.
We'll be using these consistency checks as part of the testing coverage for upcoming changes to transaction isolation.
Epic: None
Release notes: None