-
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: duplicate FK detection during initialization broken #37590
Comments
This is happening because #37433 (somewhat unintentionally) fixed a bug in foreign key validation. The bug was that we would previously allow things like
where one FK is on the primary key and the other is on some other index. We weren't including the PK when validating uniqueness of columns in FK constraints across a table, so The column that's being used twice here is It's not clear to me how to fix these tests. My understanding is that the tpcc roachtests rely on the old incorrect test fixtures with both FK constraints on |
Also, to clarify, we weren't actually hitting the hardcoded |
Got it, thanks for looking into this @lucy-zhang. As we discussed offline, So it sounds like the solution is to remove compatibility with fixtures that contain this incorrect index and foreign key. Conveniently, I already needed to regenerate fixtures for #36854, so I think it's time to just go ahead and do that. Doing so and merging #36854 will resolve this issue. |
37614: sql: add regression logic tests for FKs r=lucy-zhang a=lucy-zhang A recent change incidentally fixed a bug where a single column in a table could have multiple FK constraints, if one of the indexes for the FKs was the primary key. This PR adds regression tests. Related to #37590. Release note: None Co-authored-by: Lucy Zhang <[email protected]>
The following TPCC roachtests have been failing for the past 3 days:
The tests are now failing with the following error while loading their fixtures:
This is almost certainly related to #37433, which was merged 4 days ago and touched some of the related logic in
create_table.go
. That change seems to be interacting poorly with duplicate foreign key detection here:cockroach/pkg/workload/tpcc/tpcc.go
Lines 277 to 280 in 58c567a
The detection in
workload/tpcc
is regrettably using string matching instead of checking the pg error code. We should change it to search forCodeInvalidForeignKeyError
instead.@lucy-zhang The fix for this in
tpcc.go
is very straightforward and I'm happy to make that change, but before doing so, I want to make sure this isn't detecting an actual issue or unexpected change in behavior. A quick look over 3c49a5f doesn't show any deliberate reason why the error string returned here would have changed. Was this change in behavior expected?NOTE: Most of these issues had previous failures, so once this problem is fixed, we should go back and minimize the comments about this (those in the past 3 days) instead of closing the issues entirely.
The text was updated successfully, but these errors were encountered: