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(sql-backend): change stream node type from json to binary to fix stack overflow #15040

Merged
merged 14 commits into from
Feb 7, 2024

Conversation

yezizp2012
Copy link
Member

@yezizp2012 yezizp2012 commented Feb 6, 2024

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

What's changed and what's your intention?

As title. The stack overflow issue is caused accidentally when sea-orm is trying to deserialize column stream_node from table fragment. But when I tried deserializing the problematic data manually using serde_json, it did't show up. At present, it seems that only changing the type of this column can temporarily fix it.

  1. changed stream_node type from json to binary to avoid some deserialization issues inside sea-orm.
  2. some optimization to avoid returning the inserted model when it's not necessary.
  3. bump sea-orm version.

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.

@github-actions github-actions bot added the type/fix Bug fix label Feb 6, 2024
@kwannoel kwannoel self-requested a review February 7, 2024 06:15
@yezizp2012 yezizp2012 marked this pull request as ready for review February 7, 2024 06:23
@yezizp2012 yezizp2012 requested a review from a team as a code owner February 7, 2024 06:23
src/ctl/Cargo.toml Outdated Show resolved Hide resolved
serde = { version = "1", features = ["derive"] }
serde_json = "1"
serde = { version = "1.0.196", features = ["derive"] }
serde_json = "1.0.113"
Copy link
Contributor

Choose a reason for hiding this comment

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

Shall we revert the rest of the version upgrade as well?

Copy link
Member Author

Choose a reason for hiding this comment

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

The previous version was a bit outdated. The bump should have no harm, and it might be helpful for debugging stack overflow issue later. 🤔 I prefer to keep it.

Copy link
Member

@BugenZhao BugenZhao Feb 7, 2024

Choose a reason for hiding this comment

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

The best practice should be only to bump the version in Cargo.lock through cargo update -p .., instead of making it a constraint in Cargo.toml.

BTW, the major motivation for introducing code owner for Cargo.lock is to avoid bumping dependency in a PR for other purposes.

Copy link
Member

Choose a reason for hiding this comment

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

The bump should have no harm

This is hard to say. Developers would review the change logs in the PRs opened by the dependency bot.

Copy link
Member Author

Choose a reason for hiding this comment

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

Indeed. I see, I should bump the version in a separate PR using cargo update -p instead of messing it with other logics.

The bump should have no harm

This is hard to say. Developers would review the change logs in the PRs opened by the dependency bot.

I have checked the change logs in sea-orm in order to find some clues to identify the issue. So it might be ok, since sea-orm is only used in meta and under testing. Won't do it next time. 😢

Btw, shall we remove all constraint in Cargo.toml and let them managed by Cargo.lock in a unified manner.

Copy link
Member

Choose a reason for hiding this comment

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

If we confirm that the issue only gets fixed after a minor version, then specifying the version as a requirement looks good. For serde, it would be more suitable to keep the version as 1 since it is a regular bump. 😄

Copy link
Contributor

@kwannoel kwannoel left a comment

Choose a reason for hiding this comment

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

Generally LGTM.

Copy link
Contributor

@wangrunji0408 wangrunji0408 left a comment

Choose a reason for hiding this comment

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

rubber stamp for Cargo.lock

@yezizp2012 yezizp2012 added this pull request to the merge queue Feb 7, 2024
Merged via the queue into main with commit 05b84b4 Feb 7, 2024
27 of 28 checks passed
@yezizp2012 yezizp2012 deleted the zp/fix-meta-stack-overflow branch February 7, 2024 09:20
github-actions bot pushed a commit that referenced this pull request Feb 7, 2024
…stack overflow (#15040)

Signed-off-by: dependabot[bot] <[email protected]>
Signed-off-by: Bugen Zhao <[email protected]>
Co-authored-by: yezizp2012 <[email protected]>
Co-authored-by: Li0k <[email protected]>
Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
Co-authored-by: dependabot[bot] <dependabot[bot]@users.noreply.github.com>
Co-authored-by: Richard Chien <[email protected]>
Co-authored-by: Bugen Zhao <[email protected]>
Co-authored-by: Dylan <[email protected]>
Co-authored-by: Noel Kwan <[email protected]>
yezizp2012 pushed a commit that referenced this pull request Feb 7, 2024
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.

8 participants