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

Tracking: Eliminate usages of RwError #4077

Closed
7 of 8 tasks
fuyufjh opened this issue Jul 21, 2022 · 9 comments
Closed
7 of 8 tasks

Tracking: Eliminate usages of RwError #4077

fuyufjh opened this issue Jul 21, 2022 · 9 comments
Assignees
Labels
difficulty/medium Issues that need some knowledge of the whole system help wanted Issues that need help from contributors type/enhancement Improvements to existing implementation.

Comments

@fuyufjh
Copy link
Member

fuyufjh commented Jul 21, 2022

@BugenZhao (Nov 29, 2023): See motivation here #13588 (comment)


Also I suggest avoiding using RwError everywhere. RwError is designed to have 1-1 correspondence with Postgres. However, not all our results will be reported to Postgres shell -- meta error, cli error, dashboard error, stream error, they won't have any interaction with Postgres.

I think the first step is to introduce per-crate error type.

Originally posted by @skyzh in #1367 (comment)

@fuyufjh fuyufjh added type/enhancement Improvements to existing implementation. good first issue Good for newcomers help wanted Issues that need help from contributors labels Jul 21, 2022
@BugenZhao
Copy link
Member

Related:

@fuyufjh
Copy link
Member Author

fuyufjh commented Aug 15, 2023

I decided to bring this back to milestone because RwError seems to be a potential performance killer, and it's very hard to use any testing to eliminate. Refactoring seems the only way.

Batch and connector mod seems to be the major blockers now. Please take a look ❤️ cc. @tabVersion @liurenjie1024

@liurenjie1024
Copy link
Contributor

I decided to bring this back to milestone because RwError seems to be a potential performance killer, and it's very hard to use any testing to eliminate. Refactoring seems the only way.

Batch and connector mod seems to be the major blockers now. Please take a look ❤️ cc. @tabVersion @liurenjie1024

Why RwError is a performance killer? Since it may use backtrace?

@fuyufjh
Copy link
Member Author

fuyufjh commented Aug 15, 2023

Yeah, it always captures the stacktrace.

I think we need to eliminate usage of RwError completely inside RisingWave, but only use it as a way to return Error to Users. Btw, @BugenZhao is working on a more sophisticated solution, but this is a good starting point.

@liurenjie1024
Copy link
Contributor

Yeah, it always captures the stacktrace.

I think we need to eliminate usage of RwError completely inside RisingWave, but only use it as a way to return Error to Users. Btw, @BugenZhao is working on a more sophisticated solution, but this is a good starting point.

Hmm, then we will lose contexts.

@BugenZhao
Copy link
Member

Hmm, then we will lose contexts.

I guess providing contexts doesn't have to be done through backtrace. For errors triggered by users (like ExprError), the original input could be much more meaningful than a static backtrace. We can choose some of the error variants that are believed as internal errors and add the backtrace field specifically for them.

@fuyufjh
Copy link
Member Author

fuyufjh commented Aug 15, 2023

Yeah, it always captures the stacktrace.
I think we need to eliminate usage of RwError completely inside RisingWave, but only use it as a way to return Error to Users. Btw, @BugenZhao is working on a more sophisticated solution, but this is a good starting point.

Hmm, then we will lose contexts.

As Bugen mentioned, we can keep some backtrace for internal errors. But for user-facing errors such as parser error, it doesn't make sense to capture the stacktrace

@fuyufjh fuyufjh modified the milestones: release-1.2, release-1.3 Sep 11, 2023
@fuyufjh fuyufjh modified the milestones: release-1.3, release-1.4 Oct 10, 2023
@fuyufjh fuyufjh removed this from the release-1.4 milestone Nov 8, 2023
@fuyufjh
Copy link
Member Author

fuyufjh commented Nov 8, 2023

@BugenZhao PTAL

@BugenZhao
Copy link
Member

BugenZhao commented Feb 26, 2024

Only the frontend crate remains to be refactored. I'd like to close this issue and let #2366 track that.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
difficulty/medium Issues that need some knowledge of the whole system help wanted Issues that need help from contributors type/enhancement Improvements to existing implementation.
Projects
None yet
Development

No branches or pull requests

4 participants