-
Notifications
You must be signed in to change notification settings - Fork 5k
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
[chain filters] should not be using inactive fields for joins #39635
Conversation
|
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.
Makes sense to me. A pity about the manual reset, but doesn't seem worth rabbit holing for a small bug fix.
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.
This PR seems to be fixing a symptom of the issue, not the root cause.
The fact that a field referenced by fk_target_field_id
is inactive is real issue here. That state should be impossible. I thought I fixed that in Remove a retired field's FK target references during sync. It's possible that there was some edge case that I missed. If so we'll need to do another migration like this.
This fix is unfortunately too narrow because it fixes one symptom of the bug but it means there's probably other ways this becomes an issue out there. Having to check that a field is active every time we use fk_target_field_id
is error prone and complicates the code everywhere we use this information.
d11adc0
to
d8774bc
Compare
@calherries hmm... I'm not understanding semantics completely, but is a field being inactive an error at all times? |
No, but a foreign key reference to an inactive field is definitely a bug, because the constraint doesn't exist in the database. This is a special case of the bug I raised yesterday #39687 (total coincidence though) |
Opening this again because I feel we should just land this rather than talking about solutions more. |
d8774bc
to
d8bef01
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.
Looks good
d8bef01
to
7cfe353
Compare
@piranha Did you forget to add a milestone to the issue for this PR? When and where should I add a milestone? |
@metabase-bot backport release-x.48.x |
#39847) Co-authored-by: Alexander Solovyov <alexander@solovyov.net>
#39849) Co-authored-by: Alexander Solovyov <alexander@solovyov.net>
Resolves #39618