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

feat: add rw_rate_limit system catalog #19466

Merged
merged 3 commits into from
Nov 20, 2024
Merged

Conversation

xxchan
Copy link
Member

@xxchan xxchan commented Nov 20, 2024

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

What's changed and what's your intention?

It's not easy to know what jobs are rate limited, so add this.

I want to avoid iterating over all fragments, so I introduced a new fragment flag for FsFetch. This means rw_rate_limit won't show fs fragments created before this PR, and I think it's acceptable.

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.

Copy link
Member Author

xxchan commented Nov 20, 2024

@xxchan xxchan changed the title fix: fix alter rate limit for mv on fs source feat: add rate limit info to system catalog Nov 20, 2024
@xxchan xxchan changed the title feat: add rate limit info to system catalog feat: add rw_rate_limit system catalog Nov 20, 2024
@xxchan xxchan marked this pull request as ready for review November 20, 2024 02:10
@xxchan xxchan removed the type/fix Bug fix label Nov 20, 2024
@xxchan xxchan force-pushed the 11-16-feat_support_rw_rate_limit branch 2 times, most recently from 8e28432 to 425261d Compare November 20, 2024 02:37
Comment on lines 24 to 25
#[primary_key]
fragment_id: i32,
Copy link
Member Author

Choose a reason for hiding this comment

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

Maybe in theory 1 fragment can have multiple rate-limited nodes and it's not primary key

@xxchan
Copy link
Member Author

xxchan commented Nov 20, 2024

Oops. Seems this system catalog is not isolated between databases 🤔

image

Some catalogs support this, but some don't: e.g,

  • rw_tables is isolated
  • rw_fragments is not

@yezizp2012
Copy link
Member

Oops. Seems this system catalog is not isolated between databases 🤔

image Some catalogs support this, but some don't: e.g,
  • rw_tables is isolated
  • rw_fragments is not

System catalogs about metadata of the streaming job are all not isolated between databases. They are used solely for debugging.

@xxchan
Copy link
Member Author

xxchan commented Nov 20, 2024

Yes, I was also a little hesitant to add isolation which might hurt debugging. 🤪

Copy link
Member

@yezizp2012 yezizp2012 left a comment

Choose a reason for hiding this comment

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

LGTM

fn bitflag_intersects(column: SimpleExpr, value: i32) -> SimpleExpr {
column
.binary(BinOper::Custom("&"), value)
.binary(BinOper::NotEqual, 0)
Copy link
Member

Choose a reason for hiding this comment

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

👍 Wow, it can actually be written like this. Does it work for PostgreSQL and MySQL backends? I'm not sure if these slts are covered by e2e tests for other backends. Cc @BugenZhao

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 checked their doc and tested locally and it works fine.

But seems not covered in CI.

Copy link
Member Author

xxchan commented Nov 20, 2024

Merge activity

  • Nov 20, 3:57 PM GMT+8: A user started a stack merge that includes this pull request via Graphite.
  • Nov 20, 3:58 PM GMT+8: Graphite couldn't merge this pull request because a downstack PR fix: fix potential data loss for shared source #19443 failed to merge.
  • Nov 20, 7:42 PM GMT+8: Graphite rebased this pull request after merging its parent, because this pull request is set to merge when ready.
  • Nov 20, 8:35 PM GMT+8: Graphite couldn't merge this PR because it failed for an unknown reason (This repository has GitHub's merge queue enabled, which is currently incompatible with Graphite).
  • Nov 20, 8:36 PM GMT+8: Graphite couldn't merge this PR because it failed for an unknown reason (This repository has GitHub's merge queue enabled, which is currently incompatible with Graphite).

@xxchan xxchan force-pushed the 11-16-feat_support_rw_rate_limit branch from 40227bb to 6f13304 Compare November 20, 2024 08:03
@xxchan xxchan force-pushed the 11-16-feat_support_backfill_rate_limit_for_source_backfill branch from 3993c63 to a7a89ea Compare November 20, 2024 10:52
@xxchan xxchan changed the base branch from 11-16-feat_support_backfill_rate_limit_for_source_backfill to graphite-base/19466 November 20, 2024 11:34
feat: support rw_rate_limit

refine

Signed-off-by: xxchan <[email protected]>

fix primary key

Signed-off-by: xxchan <[email protected]>
Signed-off-by: xxchan <[email protected]>
Signed-off-by: xxchan <[email protected]>
@xxchan xxchan force-pushed the graphite-base/19466 branch from a7a89ea to fe69ce3 Compare November 20, 2024 11:42
@xxchan xxchan force-pushed the 11-16-feat_support_rw_rate_limit branch from 561e063 to ebc55b3 Compare November 20, 2024 11:42
@xxchan xxchan changed the base branch from graphite-base/19466 to main November 20, 2024 11:42
github-merge-queue bot pushed a commit that referenced this pull request Nov 20, 2024
@graphite-app graphite-app bot requested a review from a team November 20, 2024 12:34
@xxchan xxchan added this pull request to the merge queue Nov 20, 2024
Merged via the queue into main with commit 3fdd6a5 Nov 20, 2024
32 of 33 checks passed
@xxchan xxchan deleted the 11-16-feat_support_rw_rate_limit branch November 20, 2024 13:42
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants