Skip to content
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

fix(meta): fix column binding for fragment ids #16133

Merged
merged 1 commit into from
Apr 7, 2024

Conversation

yezizp2012
Copy link
Member

I hereby agree to the terms of the RisingWave Labs, Inc. Contributor License Agreement.

What's changed and what's your intention?

Fixes from #16090 .

Checklist

  • I have written necessary rustdoc comments
  • I have added necessary unit tests and integration tests
  • I have added test labels as necessary. See details.
  • I have added fuzzing tests or opened an issue to track them. (Optional, recommended for new SQL features Sqlsmith: Sql feature generation #7934).
  • My PR contains breaking changes. (If it deprecates some features, please create a tracking issue to remove them in the future).
  • All checks passed in ./risedev check (or alias, ./risedev c)
  • My PR changes performance-critical code. (Please run macro/micro-benchmarks and show the results.)
  • My PR contains critical fixes that are necessary to be merged into the latest release. (Please check out the details)

Documentation

  • My PR needs documentation updates. (Please use the Release note section below to summarize the impact on users)

Release note

If this PR includes changes that directly affect users or other significant modifications relevant to the community, kindly draft a release note to provide a concise summary of these changes. Please prioritize highlighting the impact these changes will have on users.

@yezizp2012 yezizp2012 requested review from xxchan and BugenZhao April 3, 2024 09:32
@github-actions github-actions bot added the type/fix Bug fix label Apr 3, 2024
let actors: Vec<(ActorId, Vec<ActorId>)> = Actor::find()
let actors: Vec<(ActorId, ActorUpstreamActors)> = Actor::find()
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

How did you find this is wrong? 🤡

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I was running some tests locally and the meta failed to restart when load_backfill_fragment_ids. 🥵

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Wait, does it means that this is a serious bug and we need to patch it ASAP?

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

😄 no worries, these part of codes are not in the release 1.8.

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Yes, this can be triggered whenever any fragment is created (why?), like CREATE TABLE t(), and then restart risingwave.

Comment on lines 1113 to 1117
upstream_ids
.into_inner()
.into_iter()
.flat_map(|(_, ids)| ids.into_iter())
.collect(),
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I think we can return the UpstreamActorIds as-is here, and only map once in the caller site

Copy link
Member

@xxchan xxchan left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM. But thinking how can we prevent such silly mistakes. 🥵

@yezizp2012 yezizp2012 added this pull request to the merge queue Apr 7, 2024
@yezizp2012 yezizp2012 removed this pull request from the merge queue due to a manual request Apr 7, 2024
@yezizp2012 yezizp2012 requested a review from a team as a code owner April 7, 2024 07:00
@yezizp2012 yezizp2012 force-pushed the fix/sql-column-binding branch from 5ac5d67 to b0391c8 Compare April 7, 2024 07:01
@yezizp2012 yezizp2012 enabled auto-merge April 7, 2024 07:02
@yezizp2012
Copy link
Member Author

LGTM. But thinking how can we prevent such silly mistakes. 🥵

Didn't find a way while using the APIs of sea-orm. 🥵 We may only rely on e2e to prevent it.

@yezizp2012 yezizp2012 added this pull request to the merge queue Apr 7, 2024
Merged via the queue into main with commit e811ad7 Apr 7, 2024
26 of 27 checks passed
@yezizp2012 yezizp2012 deleted the fix/sql-column-binding branch April 7, 2024 07:28
@xxchan
Copy link
Member

xxchan commented Apr 8, 2024

We may only rely on e2e to prevent it.

I think we can have a test case like simply stop and restart meta... 🤔

@xxchan
Copy link
Member

xxchan commented Apr 8, 2024

Wait, don't we already have this?

@yezizp2012
Copy link
Member Author

Wait, don't we already have this?

Waiting for support in Madsim: #15612

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
type/fix Bug fix
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants