-
Notifications
You must be signed in to change notification settings - Fork 590
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(udf): support always_retry_on_network_error
config for udf functions
#15163
Merged
Merged
Changes from all commits
Commits
Show all changes
11 commits
Select commit
Hold shift + click to select a range
f4b63d4
add test
kwannoel 058b794
add always_retry_on_error config to frontend + update proto
kwannoel 6f02786
link the config to expr_udf
kwannoel c2b338d
update test for both paths
kwannoel 5b3aff1
always run python udf test e2e
kwannoel d1701ab
fix ut
kwannoel 748ea24
make naming consistent
kwannoel 41d1b83
add column in migrator
yezizp2012 12d7709
fmt
kwannoel 5adfcec
Update src/expr/udf/src/external.rs
kwannoel 44bd236
address review comments
kwannoel File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,75 @@ | ||
system ok | ||
python3 e2e_test/udf/test.py & | ||
|
||
# wait for server to start | ||
sleep 10s | ||
|
||
statement ok | ||
CREATE FUNCTION sleep_always_retry(INT) RETURNS INT AS 'sleep' USING LINK 'http://localhost:8815' WITH ( always_retry_on_network_error = true ); | ||
|
||
statement ok | ||
CREATE FUNCTION sleep_no_retry(INT) RETURNS INT AS 'sleep' USING LINK 'http://localhost:8815'; | ||
|
||
# Create a table with 30 records | ||
statement ok | ||
CREATE TABLE t (v1 int); | ||
|
||
statement ok | ||
INSERT INTO t select 0 from generate_series(1, 30); | ||
|
||
statement ok | ||
flush; | ||
|
||
statement ok | ||
SET STREAMING_RATE_LIMIT=1; | ||
|
||
statement ok | ||
SET BACKGROUND_DDL=true; | ||
|
||
statement ok | ||
CREATE MATERIALIZED VIEW mv_no_retry AS SELECT sleep_no_retry(v1) as s1 from t; | ||
|
||
# Create a Materialized View | ||
statement ok | ||
CREATE MATERIALIZED VIEW mv_always_retry AS SELECT sleep_always_retry(v1) as s1 from t; | ||
|
||
# Immediately kill the server, sleep for 1minute. | ||
system ok | ||
pkill -9 -i python && sleep 60 | ||
|
||
# Restart the server | ||
system ok | ||
python3 e2e_test/udf/test.py & | ||
|
||
# Wait for materialized view to be complete | ||
statement ok | ||
wait; | ||
|
||
query I | ||
SELECT count(*) FROM mv_always_retry where s1 is NULL; | ||
---- | ||
0 | ||
|
||
query B | ||
SELECT count(*) > 0 FROM mv_no_retry where s1 is NULL; | ||
---- | ||
t | ||
|
||
statement ok | ||
SET STREAMING_RATE_LIMIT=0; | ||
|
||
statement ok | ||
SET BACKGROUND_DDL=false; | ||
|
||
# close the server | ||
system ok | ||
pkill -i python | ||
|
||
statement ok | ||
DROP FUNCTION sleep_always_retry; | ||
|
||
statement ok | ||
DROP FUNCTION sleep_no_retry; | ||
|
||
statement ok | ||
DROP TABLE t CASCADE; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.
Oops, something went wrong.
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
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.
Should we put all
disable_retry_count
related stuff inelse
branch?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.
Hmm no difference to me? Seems to add more nesting.
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.
I think mixing them together can lead to confusion. Why do we still update
disable_retry_count
whenalways_retry_on_network_error
?If nesting doesn't look good, we can add a sth like
call_with_ disable_retry_count
...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.
Ah I didn't get what you meant originally. Now I do. Updated it.